Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache tries to download php files!
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
Narada
Guru
Guru


Joined: 12 Dec 2002
Posts: 300
Location: London, UK

PostPosted: Wed May 07, 2003 12:29 pm    Post subject: Apache tries to download php files! Reply with quote

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


Joined: 29 Apr 2003
Posts: 174
Location: Czech republic

PostPosted: Wed May 07, 2003 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
smokeslikeapoet
Tux's lil' helper
Tux's lil' helper


Joined: 03 Apr 2003
Posts: 96
Location: Cordova, TN USA

PostPosted: Sun Jun 01, 2003 4:47 am    Post subject: Reply with 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.
_________________
-SmokesLikeaPoet

Folding@Home
Back to top
View user's profile Send private message
lash
n00b
n00b


Joined: 01 Jun 2003
Posts: 1

PostPosted: Sun Jun 01, 2003 8:14 am    Post subject: Reply with quote

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


Joined: 21 Oct 2002
Posts: 13
Location: Riga

PostPosted: Sun Jun 01, 2003 3:38 pm    Post subject: Reply with quote

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


Joined: 21 Jan 2003
Posts: 21

PostPosted: Sun Jun 01, 2003 9:08 pm    Post subject: Reply with quote

When you switched over to apache2, did you add

Code:
USE="apache2"

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
View user's profile Send private message
unstable_geek
Tux's lil' helper
Tux's lil' helper


Joined: 01 Mar 2003
Posts: 102
Location: In my own happy place

PostPosted: Fri Aug 15, 2003 1:15 am    Post subject: Still not working for me Reply with quote

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
View user's profile Send private message
MrPyro
Tux's lil' helper
Tux's lil' helper


Joined: 14 Aug 2003
Posts: 121
Location: Sheffield, England

PostPosted: Fri Aug 15, 2003 11:25 am    Post subject: Reply with quote

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
View user's profile Send private message
unstable_geek
Tux's lil' helper
Tux's lil' helper


Joined: 01 Mar 2003
Posts: 102
Location: In my own happy place

PostPosted: Fri Aug 15, 2003 2:49 pm    Post subject: Reply with quote

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


Joined: 03 Jul 2002
Posts: 62
Location: France (Paris)

PostPosted: Tue Aug 19, 2003 7:24 am    Post subject: Reply with quote

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


Joined: 03 Jul 2002
Posts: 62
Location: France (Paris)

PostPosted: Tue Aug 19, 2003 8:44 am    Post subject: Reply with quote

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


Joined: 20 Aug 2003
Posts: 3
Location: Sweden

PostPosted: Wed Aug 20, 2003 5:23 pm    Post subject: Reply with quote

putzmanjr19 wrote:
When you switched over to apache2, did you add

Code:
USE="apache2"

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
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