Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache not executing PHP code on gentoo 64
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
oandarilho01
Tux's lil' helper
Tux's lil' helper


Joined: 17 Nov 2005
Posts: 132
Location: Rio de Janeiro/RJ - Brasil

PostPosted: Tue Dec 13, 2011 2:10 pm    Post subject: Apache not executing PHP code on gentoo 64 Reply with quote

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


Joined: 29 Sep 2005
Posts: 621
Location: Yeovil, Somerset, UK

PostPosted: Tue Dec 13, 2011 9:19 pm    Post subject: Re: Apache not executing PHP code on gentoo 64 Reply with quote

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


Joined: 01 Dec 2002
Posts: 3337
Location: de

PostPosted: Thu Jan 05, 2012 1:00 pm    Post subject: Reply with quote

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


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Thu Jan 05, 2012 4:29 pm    Post subject: Reply with quote

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


Joined: 01 Dec 2002
Posts: 3337
Location: de

PostPosted: Fri Jan 06, 2012 5:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Fri Nov 15, 2013 11:40 pm    Post subject: Reply with quote

2.2.25 apache didn't deploy with 70_mod_php or php 5.5.6 & 5.5.4... thus my thread necromancy. sorry :evil:
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