View previous topic :: View next topic |
Author |
Message |
oandarilho01 Tux's lil' helper
Joined: 17 Nov 2005 Posts: 132 Location: Rio de Janeiro/RJ - Brasil
|
Posted: Tue Dec 13, 2011 2:10 pm Post subject: Apache not executing PHP code on gentoo 64 |
|
|
Hi,
I used to run a VPS gentoo 32 bits with some Apache VHOSTs.
Then occurred a problem on the VPS that forced me to reinstall the OS, and from that moment the VPS gentoo template became 64 bits.
Since that I can't get my VHOSTs to work again because apache is not executing PHP code normally.
I tested and it execute PHP code when I use DEFAULT_VHOST option, but I don't want to use it. If I load apache w/o it, PHP code is printed out on the browser.
Some guys on a IRC gentoo channel suggested that now there's some kind of VHOST-oriented PHP config.
Can someone here help me?
Thanks in advance |
|
Back to top |
|
|
gerdesj l33t
Joined: 29 Sep 2005 Posts: 621 Location: Yeovil, Somerset, UK
|
Posted: Tue Dec 13, 2011 9:19 pm Post subject: Re: Apache not executing PHP code on gentoo 64 |
|
|
Have you set -D PHP5 in /etc/conf.d/apache? That should be all you need.
Can you post an example <vhost>.conf so we have something to work with.
Cheers
Jon |
|
Back to top |
|
|
musv Advocate
Joined: 01 Dec 2002 Posts: 3337 Location: de
|
Posted: Thu Jan 05, 2012 1:00 pm Post subject: |
|
|
After the last update I have the same problem. Did I forget to configure something?
/etc/conf.d/apache2: | APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D MANUAL -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5" |
Code: | eix -ecI php
[I] dev-lang/php (5.4.0_rc4(5.4)@04.01.2012): The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs.
eix -ecI apache
[I] www-servers/apache (2.2.21-r1(2)@05.01.2012): The Apache Web Server. |
revdep rebuild tells me, that my system is consistent.
When I call: http://localhost/phpinfo.php I get:
Code: | <?php phpinfo(); ?> |
|
|
Back to top |
|
|
Yuu Apprentice
Joined: 23 Dec 2008 Posts: 223 Location: France
|
Posted: Thu Jan 05, 2012 4:29 pm Post subject: |
|
|
Hi,
did you have this line on your /etc/apache2/httpd.conf ?
Code: | Include /etc/apache2/modules.d/*.conf |
This line include all .conf files in the modules.d/ directory.
Another interesting file linked to this previous setting is : /etc/apache2/modules.d/70_mod_php5.conf :
Code: | <IfDefine PHP5>
# Load the module first
<IfModule !mod_php5.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
# Set it to handle the files
<IfModule mod_mime.c>
AddHandler application/x-httpd-php .php .php5 .phtml
AddHandler application/x-httpd-php-source .phps
</IfModule>
DirectoryIndex index.php index.phtml
</IfDefine> |
This allow .php, .php5 and .phtml files to use the PHP handler.
Good luck :} _________________ Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64 |
|
Back to top |
|
|
musv Advocate
Joined: 01 Dec 2002 Posts: 3337 Location: de
|
Posted: Fri Jan 06, 2012 5:14 pm Post subject: |
|
|
Yuu wrote: | Another interesting file linked to this previous setting is : /etc/apache2/modules.d/70_mod_php5.conf : |
For some reason that file was missing. Thx, that solved the problem. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Fri Nov 15, 2013 11:40 pm Post subject: |
|
|
2.2.25 apache didn't deploy with 70_mod_php or php 5.5.6 & 5.5.4... thus my thread necromancy. sorry |
|
Back to top |
|
|
|