You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Scott Bowden <st...@gmail.com> on 2006/08/10 00:46:01 UTC

[users@httpd] problem with apache and php files

I'm having some difficulty getting apache2 configured, and after doing
quite a lot of googling, I'm pretty well stumped as to where to go.

Let me preface this by saying that it's entirely possible I've done
something very, very stupid.

That said:

I recently moved to a new server, and in the process upgraded to
apache 2.0.54, having been running apache 1.3 for quite some time. I
host around 6 or 7 different websites off this setup using vhosts. A
few of these websites use php4.

I seem to have gotten myself into the following situation:

There are three sites:

  1. example.com
  2. www.example.com
  3. test.example.com

The first two are actually the same site. The third is a separate
site. All three have "index.php" in their document root - though not
the same 'index.php'. (1 and 2 share one, 3 has it's own, entirely
other).

PHP works perfectly on test.example.com. It also works perfectly on
www.example.com. However, on example.com, every time I try to load up
the root (ie. http://example.com/), Apache 2 attempts to let me (using
FireFox) download the file, instead of parsing it.

It gets stranger.

If I go to http://example.com/index.php , it works perfectly. Only
when going to the root (http://example.com) do I see this behavior.
Every PHP file on the server works exactly as it should. Only if I
load up the root is there a problem.

Stranger still: if I choose to download the file, the transaction does
not appear in any log files. It's as though it never happened.

Nothing I try gets this to reproduce on www.example.com and
test.example.com. Only on the bare example.com can I get this to
occur.

I've looked through my configs, and nothing jumps out at me. I've even
switched the hosts around. I moved the config for test.example.com
into the config file for example.com - no dice (the error occurred). I
changed the example.com config so that it was now set (via the
ServerName directive) to be test.example.com, and it worked
flawlessly.

In short, no matter which of the three configurations I use, they work
flawlessly if their ServerName is anything other than 'example.com'.
If their ServerName is 'example.com', every single one of them
attempts to have the user download index.php if the user tries to load
'http://example.com/'.

I'm fairly convinced this is not a PHP issue, because as I've said, 2
of the 3 sites work flawlessly - and in fact, all of them work
flawlessly if they are not vhosts for 'example.com'. So, I'm left with
this being an apache configuration issue.

Anyone have any ideas?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with apache and php files

Posted by Joshua Slive <jo...@slive.ca>.
On 8/9/06, Scott Bowden <st...@gmail.com> wrote:

> Stranger still: if I choose to download the file, the transaction does
> not appear in any log files. It's as though it never happened.

Clear your cache and/or try a different browser.  Also make sure there
are no proxies between the client and the server.

It is extremely unlikely that a request received by the server would
not be logged, so this symptom implies that server never sees the
request (or that your logfiles are misconfigured).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with apache and php files

Posted by Pid <p...@pidster.com>.
post your vhosts

if it's downloading the PHP file it's either a caching issue in your 
browser, or it's because Apache isn't forwarding to PHP to process the 
file under some condition.


p



BGREE07 wrote:
> It could also be a cache problem. 
> If at some time in the past you had Apache incorrectly configured and
> browsed to example.com, you would have been asked to download the file.
> If you don't clear your cache, every time you browse to example.com, the
> same will happen.
> 
> I've had this problem before with PHP4 and Apache2 and no matter how
> many times I refreshed firefox, it still gave me the same dialogue.
> Clear cache, close firefox, open it again and see if that works.
> 
> -----Original Message-----
> From: Alain Wolf [mailto:wolf@k18.ch] 
> Sent: 15 August 2006 06:45 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] problem with apache and php files
> 
> Scott Bowden wrote:
>> I'm having some difficulty getting apache2 configured, and after doing
>> quite a lot of googling, I'm pretty well stumped as to where to go.
>>
>> Let me preface this by saying that it's entirely possible I've done
>> something very, very stupid.
>>
>> That said:
>>
>> I recently moved to a new server, and in the process upgraded to
>> apache 2.0.54, having been running apache 1.3 for quite some time. I
>> host around 6 or 7 different websites off this setup using vhosts. A
>> few of these websites use php4.
>>
>> I seem to have gotten myself into the following situation:
>>
>> There are three sites:
>>
>>  1. example.com
>>  2. www.example.com
>>  3. test.example.com
>>
>> The first two are actually the same site. The third is a separate
>> site. All three have "index.php" in their document root - though not
>> the same 'index.php'. (1 and 2 share one, 3 has it's own, entirely
>> other).
>>
>> PHP works perfectly on test.example.com. It also works perfectly on
>> www.example.com. However, on example.com, every time I try to load up
>> the root (ie. http://example.com/), Apache 2 attempts to let me (using
>> FireFox) download the file, instead of parsing it.
>>
>> It gets stranger.
>>
>> If I go to http://example.com/index.php , it works perfectly. Only
>> when going to the root (http://example.com) do I see this behavior.
>> Every PHP file on the server works exactly as it should. Only if I
>> load up the root is there a problem.
>>
>> Stranger still: if I choose to download the file, the transaction does
>> not appear in any log files. It's as though it never happened.
>>
>> Nothing I try gets this to reproduce on www.example.com and
>> test.example.com. Only on the bare example.com can I get this to
>> occur.
>>
>> I've looked through my configs, and nothing jumps out at me. I've even
>> switched the hosts around. I moved the config for test.example.com
>> into the config file for example.com - no dice (the error occurred). I
>> changed the example.com config so that it was now set (via the
>> ServerName directive) to be test.example.com, and it worked
>> flawlessly.
>>
>> In short, no matter which of the three configurations I use, they work
>> flawlessly if their ServerName is anything other than 'example.com'.
>> If their ServerName is 'example.com', every single one of them
>> attempts to have the user download index.php if the user tries to load
>> 'http://example.com/'.
>>
>> I'm fairly convinced this is not a PHP issue, because as I've said, 2
>> of the 3 sites work flawlessly - and in fact, all of them work
>> flawlessly if they are not vhosts for 'example.com'. So, I'm left with
>> this being an apache configuration issue.
>>
>> Anyone have any ideas?
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
> Could be a DNS issue too. When DNS fails, nowadays browers tend to
> auto-correct things. Which sometimes gives you unexpected effects while
> debugging.
> 
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] problem with apache and php files

Posted by BGREE07 <bg...@somcol.co.za>.
It could also be a cache problem. 
If at some time in the past you had Apache incorrectly configured and
browsed to example.com, you would have been asked to download the file.
If you don't clear your cache, every time you browse to example.com, the
same will happen.

I've had this problem before with PHP4 and Apache2 and no matter how
many times I refreshed firefox, it still gave me the same dialogue.
Clear cache, close firefox, open it again and see if that works.

-----Original Message-----
From: Alain Wolf [mailto:wolf@k18.ch] 
Sent: 15 August 2006 06:45 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] problem with apache and php files

Scott Bowden wrote:
> I'm having some difficulty getting apache2 configured, and after doing
> quite a lot of googling, I'm pretty well stumped as to where to go.
>
> Let me preface this by saying that it's entirely possible I've done
> something very, very stupid.
>
> That said:
>
> I recently moved to a new server, and in the process upgraded to
> apache 2.0.54, having been running apache 1.3 for quite some time. I
> host around 6 or 7 different websites off this setup using vhosts. A
> few of these websites use php4.
>
> I seem to have gotten myself into the following situation:
>
> There are three sites:
>
>  1. example.com
>  2. www.example.com
>  3. test.example.com
>
> The first two are actually the same site. The third is a separate
> site. All three have "index.php" in their document root - though not
> the same 'index.php'. (1 and 2 share one, 3 has it's own, entirely
> other).
>
> PHP works perfectly on test.example.com. It also works perfectly on
> www.example.com. However, on example.com, every time I try to load up
> the root (ie. http://example.com/), Apache 2 attempts to let me (using
> FireFox) download the file, instead of parsing it.
>
> It gets stranger.
>
> If I go to http://example.com/index.php , it works perfectly. Only
> when going to the root (http://example.com) do I see this behavior.
> Every PHP file on the server works exactly as it should. Only if I
> load up the root is there a problem.
>
> Stranger still: if I choose to download the file, the transaction does
> not appear in any log files. It's as though it never happened.
>
> Nothing I try gets this to reproduce on www.example.com and
> test.example.com. Only on the bare example.com can I get this to
> occur.
>
> I've looked through my configs, and nothing jumps out at me. I've even
> switched the hosts around. I moved the config for test.example.com
> into the config file for example.com - no dice (the error occurred). I
> changed the example.com config so that it was now set (via the
> ServerName directive) to be test.example.com, and it worked
> flawlessly.
>
> In short, no matter which of the three configurations I use, they work
> flawlessly if their ServerName is anything other than 'example.com'.
> If their ServerName is 'example.com', every single one of them
> attempts to have the user download index.php if the user tries to load
> 'http://example.com/'.
>
> I'm fairly convinced this is not a PHP issue, because as I've said, 2
> of the 3 sites work flawlessly - and in fact, all of them work
> flawlessly if they are not vhosts for 'example.com'. So, I'm left with
> this being an apache configuration issue.
>
> Anyone have any ideas?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Could be a DNS issue too. When DNS fails, nowadays browers tend to
auto-correct things. Which sometimes gives you unexpected effects while
debugging.


-- 
Email: wolf@restkultur.ch

Phone:   +41 (43) 243 93 44
Mobile:  +41 (78) 897 87 76

Kochstrasse 18
CH - 8004 Zurich
Switzerland


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with apache and php files

Posted by Alain Wolf <wo...@k18.ch>.
Scott Bowden wrote:
> I'm having some difficulty getting apache2 configured, and after doing
> quite a lot of googling, I'm pretty well stumped as to where to go.
>
> Let me preface this by saying that it's entirely possible I've done
> something very, very stupid.
>
> That said:
>
> I recently moved to a new server, and in the process upgraded to
> apache 2.0.54, having been running apache 1.3 for quite some time. I
> host around 6 or 7 different websites off this setup using vhosts. A
> few of these websites use php4.
>
> I seem to have gotten myself into the following situation:
>
> There are three sites:
>
>  1. example.com
>  2. www.example.com
>  3. test.example.com
>
> The first two are actually the same site. The third is a separate
> site. All three have "index.php" in their document root - though not
> the same 'index.php'. (1 and 2 share one, 3 has it's own, entirely
> other).
>
> PHP works perfectly on test.example.com. It also works perfectly on
> www.example.com. However, on example.com, every time I try to load up
> the root (ie. http://example.com/), Apache 2 attempts to let me (using
> FireFox) download the file, instead of parsing it.
>
> It gets stranger.
>
> If I go to http://example.com/index.php , it works perfectly. Only
> when going to the root (http://example.com) do I see this behavior.
> Every PHP file on the server works exactly as it should. Only if I
> load up the root is there a problem.
>
> Stranger still: if I choose to download the file, the transaction does
> not appear in any log files. It's as though it never happened.
>
> Nothing I try gets this to reproduce on www.example.com and
> test.example.com. Only on the bare example.com can I get this to
> occur.
>
> I've looked through my configs, and nothing jumps out at me. I've even
> switched the hosts around. I moved the config for test.example.com
> into the config file for example.com - no dice (the error occurred). I
> changed the example.com config so that it was now set (via the
> ServerName directive) to be test.example.com, and it worked
> flawlessly.
>
> In short, no matter which of the three configurations I use, they work
> flawlessly if their ServerName is anything other than 'example.com'.
> If their ServerName is 'example.com', every single one of them
> attempts to have the user download index.php if the user tries to load
> 'http://example.com/'.
>
> I'm fairly convinced this is not a PHP issue, because as I've said, 2
> of the 3 sites work flawlessly - and in fact, all of them work
> flawlessly if they are not vhosts for 'example.com'. So, I'm left with
> this being an apache configuration issue.
>
> Anyone have any ideas?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
Could be a DNS issue too. When DNS fails, nowadays browers tend to
auto-correct things. Which sometimes gives you unexpected effects while
debugging.


-- 
Email: wolf@restkultur.ch

Phone:   +41 (43) 243 93 44
Mobile:  +41 (78) 897 87 76

Kochstrasse 18
CH - 8004 Zurich
Switzerland


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: problem with apache and php files

Posted by Michelle Konzack <li...@freenet.de>.
Hi Scott,

Am 2006-08-09 18:46:01, schrieb Scott Bowden:
> Stranger still: if I choose to download the file, the transaction does
> not appear in any log files. It's as though it never happened.

I use 

apache2:
  Installiert:Pakete:2.0.54-5
  Mögliche Pakete:2.0.54-5
  Versions-Tabelle:
 *** 2.0.54-5 0
        200 http://sarge.debian.tamay-dogan.net sarge/updates/main Packages
     2.0.54-4 0
        200 http://sarge.debian.tamay-dogan.net sarge/main Packages

php5:
  Installiert:5.1.2-1.michelle.1
  Mögliche Pakete:5.1.2-1.michelle.1
  Versions-Tabelle:
 *** 5.1.2-1.michelle.1 0
        200 http://sarge.debian.tamay-dogan.net sarge/main Packages


and have the same problem with one of my VServers which host currently
7 VHosts.  Since my traffic is logged by a transparent proxy AND
iptables I know, I have around 3 times more traffic as it is loged in
the access.log or error.log.

OK, since the proxy have gotten those things, it happen only if the
client us

    http://www.domain.tld/?var=val

but not with

    http://www.domain.tld/index.php?var=val

And since the VHosts HAVE only ine file (index.php) I can not change
anything.

Now, HOW to find the PIG?

Please note, that the urls are DYNAMIC AND UNIQUE!  There is no
possibility for caching since each request gets an UNIQUE ID.  It
looks like a md5sum but it is not...

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org