View previous topic :: View next topic |
Author |
Message |
Roxxor Apprentice
Joined: 04 Jun 2003 Posts: 225 Location: Stockholm, Sweden
|
Posted: Tue May 17, 2005 2:49 pm Post subject: apache2 with php and mod_php does not work |
|
|
EDIT:
I installed another version (apache 2.0.54) and it worked.
But a new problem:
I emerged php and mod_php and added -D PHP4 in the /etc/conf.d/apache file.
I created a <?php phpinfo(); ?> file (with extension .php) in my /var/www/localhost/htdocs directory.
But the php file still doesn´t work.
Please help!
Last edited by Roxxor on Tue May 17, 2005 6:32 pm; edited 3 times in total |
|
Back to top |
|
|
Blubbmon Apprentice
Joined: 13 Feb 2004 Posts: 156 Location: Germany, Potsdam
|
Posted: Tue May 17, 2005 6:10 pm Post subject: |
|
|
You should have a look in /var/log/apache2/error_log.
BTW: Your startup command should be "/etc/init.d/apache2 start" |
|
Back to top |
|
|
Roxxor Apprentice
Joined: 04 Jun 2003 Posts: 225 Location: Stockholm, Sweden
|
Posted: Tue May 17, 2005 6:30 pm Post subject: |
|
|
Blubbmon wrote: | You should have a look in /var/log/apache2/error_log.
BTW: Your startup command should be "/etc/init.d/apache2 start" |
I installed another version (apache 2.0.54) and it worked.
But a new problem:
I emerged php and mod_php and added -D PHP4 in the /etc/conf.d/apache file.
I created a <?php phpinfo(); ?> file (with extension .php) in my /var/www/localhost/htdocs directory.
But the php file still doesn´t work.
Please help! |
|
Back to top |
|
|
stoker n00b
Joined: 13 May 2005 Posts: 28 Location: Williston, Vermont
|
Posted: Tue May 17, 2005 9:10 pm Post subject: |
|
|
Roxxor wrote: | Blubbmon wrote: | You should have a look in /var/log/apache2/error_log.
BTW: Your startup command should be "/etc/init.d/apache2 start" |
I installed another version (apache 2.0.54) and it worked.
But a new problem:
I emerged php and mod_php and added -D PHP4 in the /etc/conf.d/apache file.
I created a <?php phpinfo(); ?> file (with extension .php) in my /var/www/localhost/htdocs directory.
But the php file still doesn´t work.
Please help! |
can you explain a little better what you mean by 'the php file still doesn't work?" I'm assuming here that you can hit your web server with Firefox or whatever, but what is the output you see when you try to load your php file? have you checked your log files for any error messages? (please paste any possible error messages in your next email, it'll help us tell you what's wrong)
if you see the code itself as text, you probably don't have the php extensions mapped to PHP in your httpd.conf. if this isn't the problem, please be a little more specific.
thx - _________________ Check out my current Gentoo and FreeBSD projects at http://www.mattstorer.net |
|
Back to top |
|
|
fidel Guru
Joined: 16 Jul 2004 Posts: 407 Location: CH
|
Posted: Wed May 18, 2005 7:49 am Post subject: |
|
|
I used to have this problem as well! Have you checked, that the file in
/etc/apache2/modules.d/70_mod_php4/5(whatever version..).conf
is linked to
/etc/apache2/conf/modules.d/70_mod_php4/5.conf
??
otherwise:
Code: | #ln -sf /etc/apache2/modules.d/70_mod_php5.conf /etc/apache2/conf/modules.d/70_mod_php5.conf |
?? maybe that helps?
Did you edit
/etc/conf.d/apache2
and add something like
Code: | APACHE2_OPTS="-D SSL -D PHP5" |
? |
|
Back to top |
|
|
xgregx Apprentice
Joined: 17 Dec 2004 Posts: 181 Location: Cheshire, CT
|
Posted: Wed May 18, 2005 6:12 pm Post subject: |
|
|
Make sure you add the MIME type to the apache configuration. If it's displaying the actual PHP code instead of the html output, then apache doesn't know it's supposed to execute it. Search the forums, this problem happens very often. _________________ Half-life/Source/Urban Terror/Unreal control panel -> www.opengamepanel.org
Linux user #347899
Gentoo has USE flags for a highly configurable system.
Microsoft has SUE flags to stifle innovation |
|
Back to top |
|
|
Featherfoot Veteran
Joined: 28 Dec 2002 Posts: 1108 Location: Stuart, Florida
|
Posted: Thu May 19, 2005 3:20 am Post subject: |
|
|
I have the same problem with apache-2.0.54 and mod_php-4.3.11-r2
: My system asks me whether I want to save the .php file or execute it. It is pretty clear that it doesn't recognize the mime type.
Here is the relevant section in my /etc/conf.d/apache2 file:
Code: |
#This means that the mod_ssl.so DSO module is only loaded
# into the server when you pass "-D SSL" at startup. To
# enable WebDAV, add "-D DAV -D DAV_FS". If you installed
# mod_php then add "-D PHP4". For more options, please
# read the files in the /etc/apache2/conf/modules.d directory.
APACHE2_OPTS="-D SSL -D DOC -D PHP4"
|
Just for laughs I added some errors into /etc/apache2/conf/modules.d/70_mod_php.conf as follows:
Code: |
# vim: ft=apache sw=4 ts=4
<IfDefine PHP4>
JC1
# Load the module first
<IfModule !sapi_apache2.c>
JC2
LoadModule php4_module extramodules/libphp4.so
</IfModule>
# Set it to handle the files
<IfModule mod_mime.c>
JC3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</IfModule>
# Fix some bugs
<Files *.php>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.php3>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.php4>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.phps>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
<Files *.phtml>
# keep this the same size as post_max_size in php.ini
# LimitRequestBody 8388608
</Files>
</IfDefine>
|
I get errors and can progressively remove the JC1 JC2 and JC3 lines to make the errors go away.
What am I doing wrong? |
|
Back to top |
|
|
xgregx Apprentice
Joined: 17 Dec 2004 Posts: 181 Location: Cheshire, CT
|
Posted: Thu May 19, 2005 3:42 am Post subject: |
|
|
You should only have to edit the /etc/apache2/commonapache.conf or apache.conf. I never had to edit the file you mentioned. _________________ Half-life/Source/Urban Terror/Unreal control panel -> www.opengamepanel.org
Linux user #347899
Gentoo has USE flags for a highly configurable system.
Microsoft has SUE flags to stifle innovation |
|
Back to top |
|
|
Mord n00b
Joined: 09 Jan 2003 Posts: 68 Location: Where the rubber meets the road.
|
Posted: Thu May 19, 2005 3:46 am Post subject: |
|
|
GRRR I had the same problem, and after working on it for over an hour, launched my site in Internet Explorer and noticed that it worked just fine. Cleared the cache in Firefox and problem went away..... _________________ I feel more like I do now than I did when I got here. |
|
Back to top |
|
|
Featherfoot Veteran
Joined: 28 Dec 2002 Posts: 1108 Location: Stuart, Florida
|
Posted: Thu May 19, 2005 11:32 pm Post subject: |
|
|
Hmm....
Same thing happened here. Hurrah! |
|
Back to top |
|
|
misc Tux's lil' helper
Joined: 09 Sep 2003 Posts: 109
|
Posted: Sat May 28, 2005 3:28 am Post subject: |
|
|
Mord, thankyou for that! I only wasted half an hour until I came across this post and tried on another browser and it worked fine! |
|
Back to top |
|
|
stoker n00b
Joined: 13 May 2005 Posts: 28 Location: Williston, Vermont
|
Posted: Sat May 28, 2005 4:00 am Post subject: |
|
|
so, what, is this an error on the client side or the server side? my guess is that, based on what Mord et al are now saying, is that it's a client-side issue. sooo.... WTF? there's still an issue here, soo ... is ... this ... resolved?
now that you mention it I seem to remember having similar issues a ways back serving PHP from my FreeBSD box.. there was something I did to fix the problem... had something, maybe, to do with clearing the cache and temprary files? forget, it was a long time ago.
anyway, glad to hear the problem's been reduced to the level of annoyance-only. _________________ Check out my current Gentoo and FreeBSD projects at http://www.mattstorer.net |
|
Back to top |
|
|
Mondo1287 n00b
Joined: 26 Apr 2005 Posts: 16
|
Posted: Tue Jun 07, 2005 4:05 pm Post subject: |
|
|
I had the same problem for the last couple of days, apache wasn't loading libphp4.so at all. I moved the 70_mod_php.conf from /etc/apache2/conf/modules.d to /etc/apache2/modules.d and Apache did load libphp4.so If you look in the error log you should see Apache/2.0.54 (Gentoo/Linux) PHP/4.3.11 configured -- resuming normal operations
Then Apache was segfaulting when any page was acessed with libphp4.so loaded. I then unmerged mod_php and emerged it again and then it started working. |
|
Back to top |
|
|
chovy Guru
Joined: 03 Dec 2004 Posts: 453
|
Posted: Wed Jun 15, 2005 6:29 am Post subject: |
|
|
clearing the cache worked for me. _________________ Woof, Woof! Add "[solved]" to the title! Woof, Woof! |
|
Back to top |
|
|
DaviXX n00b
Joined: 06 May 2005 Posts: 46
|
Posted: Wed Jun 15, 2005 6:36 am Post subject: |
|
|
Hi,
after merging mod_php, a message ask you for launch :
"ebuild [...] config"
this add the necessary lines to apache conf.
so re-emerge mod_php and be aware of the messages at the end of merge. _________________ David CHANIAL
sdfrance.com - Location de serveurs dédiés infogérés
Serveurs sous Gentoo/Linux |
|
Back to top |
|
|
chovy Guru
Joined: 03 Dec 2004 Posts: 453
|
Posted: Wed Jun 15, 2005 7:14 am Post subject: |
|
|
I just emerged php-4.3.11, apache2, then mod_php-4.3.11.
Only thing I had to do was setup /etc/apache2/httpd.conf (ServerName, basic stuff, etc).
And to get mod_php to work, just add the following to /etc/conf.d/apache2
APACHE2_OPTS="-D SSL -D PHP4"
Then reboot "/etc/init.d/apache2 restart".
Clear cache, restart browser, then test it. _________________ Woof, Woof! Add "[solved]" to the title! Woof, Woof! |
|
Back to top |
|
|
|