View previous topic :: View next topic |
Author |
Message |
Narada Guru
Joined: 12 Dec 2002 Posts: 300 Location: London, UK
|
Posted: Wed May 07, 2003 12:29 pm Post subject: Apache tries to download php files! |
|
|
Hello. Earlier I had apache working with php just fine. Then I tried apache2 with php which didn't work so I went back to apache but now apache tries to download my php files instead of processing them. I urgently need php at the moment so any help would be much appreciated. If you'd like to post any particular files please let me know and I shall post them. _________________ http://dhruba.name/ |
|
Back to top |
|
|
Jacobs Apprentice
Joined: 29 Apr 2003 Posts: 174 Location: Czech republic
|
Posted: Wed May 07, 2003 12:43 pm Post subject: |
|
|
Hi, maybe there is a problem with mod_php?
try this with your mod_php version:
Code: | ebuild /usr/portage/dev-php/mod_php/mod_php-4.x.x.ebuild config |
and then make sure you have this line in /etc/conf.d/apache uncommented:
Code: | APACHE_OPTS="-D PHP4" |
hope it helps |
|
Back to top |
|
|
smokeslikeapoet Tux's lil' helper
Joined: 03 Apr 2003 Posts: 96 Location: Cordova, TN USA
|
Posted: Sun Jun 01, 2003 4:47 am Post subject: |
|
|
I had the same problem. After I got my configuration correct I still had to restart apache2 half a dozen times for it to work. I also had to clear my browser cache. I've read reports on some people getting it to work after a reboot. _________________ -SmokesLikeaPoet
Folding@Home |
|
Back to top |
|
|
lash n00b
Joined: 01 Jun 2003 Posts: 1
|
Posted: Sun Jun 01, 2003 8:14 am Post subject: |
|
|
You have to set the mime types right in the config files. My server is currently down, so I can't help you more. |
|
Back to top |
|
|
slaisc n00b
Joined: 21 Oct 2002 Posts: 13 Location: Riga
|
Posted: Sun Jun 01, 2003 3:38 pm Post subject: |
|
|
Quote: | I had the same problem. After I got my configuration correct I still had to restart apache2 half a dozen times for it to work. I also had to clear my browser cache. I've read reports on some people getting it to work after a reboot. |
when you do an /etc/init.d/apache restart, it just re-reads the configuration files. For APACHE_OPTS="-D PHP4" to take effect, you have to
Code: |
/etc/init.d/apache stop
/etci/init.d/apache start
|
I guess that might have been the problem in your case, .....took me quite a while to figure that one out |
|
Back to top |
|
|
putzmanjr19 n00b
Joined: 21 Jan 2003 Posts: 21
|
Posted: Sun Jun 01, 2003 9:08 pm Post subject: |
|
|
When you switched over to apache2, did you add
to your flags? You should have done this and then emerged mod_php again to build the correct module for apache2. If you are now going back to apache, make sure you remove apache2 from your USE flags and try to re-emerge mod_php. You'll know it's correct when libphp4.so is in /etc/apache/extramodules.
putzmanjr |
|
Back to top |
|
|
unstable_geek Tux's lil' helper
Joined: 01 Mar 2003 Posts: 102 Location: In my own happy place
|
Posted: Fri Aug 15, 2003 1:15 am Post subject: Still not working for me |
|
|
I simply cannot see whats wrong with this for me.
I completely removed apache and php.
I used ufed to set apache2 in the USE
i emerged apache
i emerged php
i have APACHE_OPTS="-D SSL -D PHP4" in /etc/conf.d/apache2
i have 70_mod_php.conf in /etc/apache2/conf/modules.d
i have libphp4.so in /etc/apache/extramodules
i have php.ini in /etc/apache2/conf
and all i get is the static html bits of my php pages. i cannot get any php to run.
i thought it might be permissions in the apache conf, so I was desperate and did this:
Code: | <Directory />
Options All -Multiviews
AllowOverride None
<IfModule mod_access.c>
Order deny,allow
Deny from all
</IfModule>
</Directory>
|
but nothing changes. in fact, I get all the php code straight out in the web browser _________________ I hate my sig |
|
Back to top |
|
|
MrPyro Tux's lil' helper
Joined: 14 Aug 2003 Posts: 121 Location: Sheffield, England
|
Posted: Fri Aug 15, 2003 11:25 am Post subject: |
|
|
Have you set the php mime type?
Code: |
<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>
|
_________________ Back off man, I'm a computer scientist |
|
Back to top |
|
|
unstable_geek Tux's lil' helper
Joined: 01 Mar 2003 Posts: 102 Location: In my own happy place
|
Posted: Fri Aug 15, 2003 2:49 pm Post subject: |
|
|
The mime type is set in /etc/apache2/conf/modules.d/70_mod_php.conf
which supposedly is being included by:
Code: | Include conf/modules.d/*.conf
|
_________________ I hate my sig |
|
Back to top |
|
|
bemixam n00b
Joined: 03 Jul 2002 Posts: 62 Location: France (Paris)
|
Posted: Tue Aug 19, 2003 7:24 am Post subject: |
|
|
i have the same problem
my configuration seems to be OK but my apache still display le "php code" instead of execute it ! _________________ Gentoo c est bieng ! |
|
Back to top |
|
|
bemixam n00b
Joined: 03 Jul 2002 Posts: 62 Location: France (Paris)
|
Posted: Tue Aug 19, 2003 8:44 am Post subject: |
|
|
yihaaaa .... i found the solution to my problem ... maybe it is yours too
in my /etc/conf.d/apache2
i have APACHE_OPTS="-D PHP4" instead of APACHE2_OPTS="-D PHP4" _________________ Gentoo c est bieng ! |
|
Back to top |
|
|
genthree n00b
Joined: 20 Aug 2003 Posts: 3 Location: Sweden
|
Posted: Wed Aug 20, 2003 5:23 pm Post subject: |
|
|
putzmanjr19 wrote: | When you switched over to apache2, did you add
to your flags? You should have done this and then emerged mod_php again to build the correct module for apache2. If you are now going back to apache, make sure you remove apache2 from your USE flags and try to re-emerge mod_php. You'll know it's correct when libphp4.so is in /etc/apache/extramodules.
putzmanjr |
THANKS !!!!
This did the trick, now PHP4 is working on my box.
Would be nice if this was mentioned in the "Desktop Configuration Guide". |
|
Back to top |
|
|
|