php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29144 PHP is not executed/not handling files
Submitted: 2004-07-14 14:41 UTC Modified: 2004-09-14 01:00 UTC
Votes:9
Avg. Score:4.9 ± 0.3
Reproduced:9 of 9 (100.0%)
Same Version:7 (77.8%)
Same OS:4 (44.4%)
From: php at soapi dot com Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5.0.0 OS: RedHat Enterprise Linux 3.0
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-07-14 14:41 UTC] php at soapi dot com
Description:
------------
First of all, my apologies for adding a new bug, but bug 26492 has been marked as bogus, and although I have added a comment, I cannot reopen it. Therefore as I believe this is indeed a PHP problem, I have created a new entry.

After building PHP5.0.0 final today, I am experiencing the exact same problem I have had with RC1, RC2, and RC3. I am currently running Apache 2.0.50, but I have tried with 2.0.48 and 2.0.49 as well. (I spent two full days a couple of weeks ago recompiling many different configurations, with no success.)

PHP compiles and installs fine, and Apache loads with no problems. There are no errors listed in the error log (which is set to flag everything) and I don't get any problems other than this one, which is that PHP files are not being processed.

I have PHP4.3.8 running right now, and every version of PHP4 has compiled, installed, and run with no problems. I am using an essentially identical configuration line for PHP5, and all I do to swap between the two is change the module that is loaded.

Even if I use a very basic Apache and PHP setup, this problem occurs. I am using a standard PHP5 ini file, with only minor changes to point it at the right directories.

So. Whenever I use PHP5, all PHP files are offered for download rather than being processed by PHP5. I have tried things like AddHandler php5-script and all sorts, with no success. As far as I am aware, I should not have to do anything substantially different to set up PHP5 than I do for PHP4.

Apache info shows that mod_php5.c is loaded successfully, so why doesn't it handle the files? I'm going mad with this.

The only thing that is different from a standard installation is that I install PHP4 and PHP5 into their own locations, in order to swap between them. For instance I use 'export EXTENSION_DIR=/usr/lib/php5' and then in the configure line I use '--program-suffix=5 --with-config-file-path=/etc/php5' with the other settings. This is simply to keep the two apart.

It would appear that for some reason PHP5 is not properly registering with Apache2 that it can handle the application/x-httpd-php MIME-type, but I have no idea why, because I have 'AddType application/x-httpd-php php' in my httpd.conf file of course.

How can I track down the problem? I'm not new to this - I have been a server admin for years (I run www.ithium.net) and I use PHP every day. I have compiled PHP and Apache countless times, and even written tutorials on the subject. So you can see why this is so frustrating.

Thanks

Dan Williams


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-14 14:53 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

It\'s still not a bug, please ask for support on the mailinglist as it works fine for hundreds of others.
 [2004-07-14 15:05 UTC] php at soapi dot com
I fail to see how this is not a bug. I subscribe to all the relevant PHP newsgroups, and there has been nothing there to help. (The fact that the newsgroups suffer from so much spam probably has a lot to do with it.)

I believe this is a bug for the simple reason that PHP4 works perfectly with the same settings, and PHP5 is not handling php scripts. That to me says some bug in how PHP5 is telling Apache what it can handle.

If there is anything that should be done in addition to the standard steps of installation, that should be clearly marked out in the documentation. However, there is nothing to suggest that anything else is needed.

Finally, please note that I *have* used the support system, and the mailing list/newsgroups, and spent many hours searching and testing before posting this report. I still believe this is a bug.
 [2004-09-06 03:53 UTC] jesse at eonstreet dot com
I have the same problem. Everything is fine except when I change the http.conf from libphp4 to libphp5.  I too believe this is a bug and has something to do with a the way the libphp5.so is tell apache2 how to handle the files.

I tried compiling "--with-apxs2" only but that did not work.
Neither "--with-apxs2=/usr/sbin/apxs --with-apxs2filter=/usr/sbin/apxs"
 [2004-09-06 04:21 UTC] rasmus@php.net
Does it work with Apache1 for you?
 [2004-09-06 09:27 UTC] jesse at eonstreet dot com
I don't know about apache1 because my server is apache2.  

The verson I am trying is 5.0.1
 [2004-09-06 18:59 UTC] rasmus@php.net
So install Apache1
 [2004-09-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-09-18 19:27 UTC] php at worldwebmaster dot com
I'm experiencing the same problem with PHP5 on Debian with Apache 1.3.34. I have tried modifying the AddType lines in httpd.conf several times to no avail.
 [2007-10-25 17:02 UTC] ekcheu at uncg dot edu
I had this problem too.  I think the problem is that the php installation is not set up right.  I managed to fix the problem by updating the php.ini file in the php installation directory to reflect the new path of the shared object modules (the php5/lib/php/extensions/no-debug-non-zts-200*  directory).
And also ran php manually by hand to see if there were any problems with any shared objects loading up (I had to add and also recompile some modules to fix the issue, or mess with the php.ini to resolve all problems).
 [2007-10-26 18:52 UTC] ekcheu at uncg dot edu
I have a better idea of what is going on with this type of bug.  What I think is happening is that if your php is somehow messed up (this happens quite frequently when you "upgrade your version of php", without also checking to see if your php.ini is up to date, and possibly some of your shared objects are not compatable with the new php binary executable - such as you are installing php in the same directory as the php4 location), it will print out messages to stdout with some error message.  Apache will see these error messages before it sees the html code.. the result being that it doesn't know what to do with the file because it doesn't recognize the resulting garbage plus html code (you're not supposed to define it anyway in httpd.conf).  So it usually asks you to download it (which is the correct response) unless you for some strange reason have incorrectly defined the type in your version of windows, or incorrectly put it in httpd.conf (such as the AddHandler directive).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 15:01:36 2024 UTC