Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 + mod_php sometimes shows source code [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bemarnet
n00b
n00b


Joined: 11 Sep 2003
Posts: 35

PostPosted: Tue Nov 04, 2003 7:46 am    Post subject: Apache2 + mod_php sometimes shows source code [SOLVED] Reply with quote

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
View user's profile Send private message
Souperman
Guru
Guru


Joined: 14 Jul 2003
Posts: 449
Location: Cape Town, South Africa

PostPosted: Tue Nov 04, 2003 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message
bemarnet
n00b
n00b


Joined: 11 Sep 2003
Posts: 35

PostPosted: Tue Nov 04, 2003 8:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Souperman
Guru
Guru


Joined: 14 Jul 2003
Posts: 449
Location: Cape Town, South Africa

PostPosted: Tue Nov 04, 2003 8:26 am    Post subject: Reply with quote

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
View user's profile Send private message
bemarnet
n00b
n00b


Joined: 11 Sep 2003
Posts: 35

PostPosted: Tue Nov 04, 2003 9:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Souperman
Guru
Guru


Joined: 14 Jul 2003
Posts: 449
Location: Cape Town, South Africa

PostPosted: Tue Nov 04, 2003 10:10 am    Post subject: Reply with quote

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
View user's profile Send private message
bemarnet
n00b
n00b


Joined: 11 Sep 2003
Posts: 35

PostPosted: Tue Nov 04, 2003 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
bemarnet
n00b
n00b


Joined: 11 Sep 2003
Posts: 35

PostPosted: Wed Nov 05, 2003 10:50 am    Post subject: Reply with quote

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
View user's profile Send private message
dsd
Developer
Developer


Joined: 30 Mar 2003
Posts: 2162
Location: nr London

PostPosted: Tue Feb 10, 2004 8:35 pm    Post subject: Reply with quote

next time, yes, you definately should, this is quite a serious bug which has just been fixed 3 months later...
_________________
http://dev.gentoo.org/~dsd
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum