View previous topic :: View next topic |
Author |
Message |
bemarnet n00b
Joined: 11 Sep 2003 Posts: 35
|
Posted: Tue Nov 04, 2003 7:46 am Post subject: Apache2 + mod_php sometimes shows source code [SOLVED] |
|
|
Hi all !
I have apache-2.0.48 and mod_php-4.3.3-r3 installed on a Pentium IV Dell computer. The apache1 version worked fine, but apache2 sometimes shows PHP source code instead of executing it.
After restarting Apache2 all works fine again... for a couple of minutes/hours.
Any idea ? I have recompiled several times both packages (Apache2 and mod_php)
Regards,
Antonio
Last edited by bemarnet on Wed Nov 05, 2003 10:48 am; edited 1 time in total |
|
Back to top |
|
|
Souperman Guru
Joined: 14 Jul 2003 Posts: 449 Location: Cape Town, South Africa
|
Posted: Tue Nov 04, 2003 7:54 am Post subject: |
|
|
So it runs fine after a restart and then after a while it shows the PHP source all the time until the next restart of Apache? Does /var/log/apache2/error_log provide any clues? _________________ moo |
|
Back to top |
|
|
bemarnet n00b
Joined: 11 Sep 2003 Posts: 35
|
Posted: Tue Nov 04, 2003 8:06 am Post subject: |
|
|
gpd wrote: | So it runs fine after a restart and then after a while it shows the PHP source all the time until the next restart of Apache? |
Not exactly, after showing PHP source code is able to serve correctly some pages, but then begins again to show source.
Quote: | Does /var/log/apache2/error_log provide any clues? |
This is the error message I see :
[error] an unknown filter was not added: PHP
I have the following lines in the commonapache.conf (I think that the error message is due to the inclusion of this lines, added following a suggestion of how to solve the problem)
AddType application/x-httpd-php php
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files> |
|
Back to top |
|
|
Souperman Guru
Joined: 14 Jul 2003 Posts: 449 Location: Cape Town, South Africa
|
Posted: Tue Nov 04, 2003 8:26 am Post subject: |
|
|
Not sure what the error message means. I've never seen PHP enabled that way before. How come you don't just do it the normal way, i.e. have "-D PHP4" in APACHE2_OPTS in /etc/conf.d/apache2? _________________ moo |
|
Back to top |
|
|
bemarnet n00b
Joined: 11 Sep 2003 Posts: 35
|
Posted: Tue Nov 04, 2003 9:44 am Post subject: |
|
|
gpd wrote: | Not sure what the error message means. I've never seen PHP enabled that way before. How come you don't just do it the normal way, i.e. have "-D PHP4" in APACHE2_OPTS in /etc/conf.d/apache2? |
Yes, I have "-D PHP4" in APACHE2_OPTS in /etc/conf.d/apache2 (I have removed the outputfilter from the Apache2 conf). |
|
Back to top |
|
|
Souperman Guru
Joined: 14 Jul 2003 Posts: 449 Location: Cape Town, South Africa
|
Posted: Tue Nov 04, 2003 10:10 am Post subject: |
|
|
bemarnet wrote: | Yes, I have "-D PHP4" in APACHE2_OPTS in /etc/conf.d/apache2 (I have removed the outputfilter from the Apache2 conf). |
Does that mean it works now? _________________ moo |
|
Back to top |
|
|
bemarnet n00b
Joined: 11 Sep 2003 Posts: 35
|
Posted: Tue Nov 04, 2003 10:17 am Post subject: |
|
|
gpd wrote: | bemarnet wrote: | Yes, I have "-D PHP4" in APACHE2_OPTS in /etc/conf.d/apache2 (I have removed the outputfilter from the Apache2 conf). |
Does that mean it works now? |
No, still fails (the output filter was added last week for testing). |
|
Back to top |
|
|
bemarnet n00b
Joined: 11 Sep 2003 Posts: 35
|
Posted: Wed Nov 05, 2003 10:50 am Post subject: |
|
|
I have detected the problem : under some situations the 'php_admin_flag engine off' in a <directory ..> block seems to affect to the full server. I have removed this directive from the apache configuration file and now works like a charm.
Should I inform to mod_php/apache2 developers in order to check for this possible bug ? |
|
Back to top |
|
|
dsd Developer
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
|
Back to top |
|
|
|