Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Cannot have php module activated on apache
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
augustin2
Apprentice
Apprentice


Joined: 16 Mar 2012
Posts: 164
Location: France

PostPosted: Tue Jan 21, 2014 4:19 pm    Post subject: [SOLVED] Cannot have php module activated on apache Reply with quote

Hi,

I have installed apache following the guide on the wiki. After that I have created en file in /var/www/localhost/htdocs/index.html with this content:
Quote:
<html>
<body>
<h1> It works and you should have php info table</h1>
<?php phpinfo(); ?>
</body>
</html>


When I point the browser on localhost I get
Quote:
It works and you should have php info table
but not the php info table. If I rename the file to index.php I only get the display of the directory content.

I have dev-lang/php installed and APACHE2_OPTS="... -D PHP5" in /etc/conf.d/apache2.


Last edited by augustin2 on Sat Feb 01, 2014 8:22 am; edited 1 time in total
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


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

PostPosted: Wed Jan 22, 2014 6:47 am    Post subject: Reply with quote

does /etc/apache2/modules.d/70_mod_php5.conf say


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>


try writing it as

/var/www/localhost/htdocs/index.php with

<?php
phpinfo();
?>

& go to localhost/index.php

instead.

if all that matches and still does not work, see troubleshooting article on wiki.gentoo.org and past more information about your setup.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
http://ecx.images-amazon.com/images/I/81Ku-vxIb3L._SL1500_.jpg
http://wiki.gentoo.org/wiki/Special:Contributions/666threesixes666
Back to top
View user's profile Send private message
augustin2
Apprentice
Apprentice


Joined: 16 Mar 2012
Posts: 164
Location: France

PostPosted: Wed Jan 22, 2014 8:14 am    Post subject: Reply with quote

Hi. Thank you for answer.
I have no 70_mod_php5.conf
Here is the content of the modules.d directory

Quote:
. 00_languages.conf 00_mod_mime.conf 10_mod_mem_cache.conf .keep_www-servers_apache-2
.. 00_mod_autoindex.conf 00_mod_status.conf 40_mod_ssl.conf
00_default_settings.conf 00_mod_info.conf 00_mod_userdir.conf 45_mod_dav.conf
00_error_documents.conf 00_mod_log_config.conf 00_mpm.conf 46_mod_ldap.conf


As for the change in index.php it doesn't change anything.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


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

PostPosted: Wed Jan 22, 2014 8:16 am    Post subject: Reply with quote

"I have no 70_mod_php5.conf"

previous thread about this "that's a show stopper"

drop my 70 into your 70 then restart apache.

-rw-r--r-- 1 root root 439 Dec 1 16:57 /etc/apache2/modules.d/70_mod_php5.conf

are my permissions.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
http://ecx.images-amazon.com/images/I/81Ku-vxIb3L._SL1500_.jpg
http://wiki.gentoo.org/wiki/Special:Contributions/666threesixes666


Last edited by 666threesixes666 on Wed Jan 22, 2014 8:17 am; edited 1 time in total
Back to top
View user's profile Send private message
XavierMiller
Moderator
Moderator


Joined: 23 Jul 2004
Posts: 5265
Location: ~Brussels - Belgique

PostPosted: Wed Jan 22, 2014 8:16 am    Post subject: Reply with quote

Hello,

Did you enable php support in Apache during emerge ?
can you provide the output of
Code:
emerge -pv apache

_________________
Xavier Miller
(FR) Merci de respecter les règles du forum.
http://www.xaviermiller.be
Back to top
View user's profile Send private message
augustin2
Apprentice
Apprentice


Joined: 16 Mar 2012
Posts: 164
Location: France

PostPosted: Wed Jan 22, 2014 11:04 am    Post subject: Reply with quote

XavierMiller wrote:
Hello,

Did you enable php support in Apache during emerge ?
can you provide the output of
Code:
emerge -pv apache


Thank you.

I have php and apache2 in use flags in make.conf but reading the apache page on the wiki maybe I should had something like APACHE2_MODULES=" php"
isn't it ?

At the moment
Code:
emerge --info apache
gives

Quote:
USE="ldap (multilib) ssl -debug -doc (-selinux) -static -suexec -threads" ABI_X86="64" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--no-as-needed"
Back to top
View user's profile Send private message
augustin2
Apprentice
Apprentice


Joined: 16 Mar 2012
Posts: 164
Location: France

PostPosted: Wed Jan 22, 2014 12:45 pm    Post subject: Reply with quote

666threesixes666 wrote:



previous thread about this "that's a show stopper"

drop my 70 into your 70 then restart apache.

-rw-r--r-- 1 root root 439 Dec 1 16:57 /etc/apache2/modules.d/70_mod_php5.conf

are my permissions.


Hum! I have trouble understanding what you mean?!
Back to top
View user's profile Send private message
augustin2
Apprentice
Apprentice


Joined: 16 Mar 2012
Posts: 164
Location: France

PostPosted: Wed Jan 22, 2014 1:25 pm    Post subject: Reply with quote

I have manually added the 70_mod_php.conf manually as 666threesixes666 decribed it in his first answer and it works.
I thought this file was automatically created at install. Should it be or not ? I didn't see that I had to do it manually neither in the apache article or in the php article in the wiki.
Back to top
View user's profile Send private message
XavierMiller
Moderator
Moderator


Joined: 23 Jul 2004
Posts: 5265
Location: ~Brussels - Belgique

PostPosted: Wed Jan 22, 2014 2:07 pm    Post subject: Reply with quote

did you add apache2 in the php USE flag ? I guess php install the config file only if that USE is enabled.
_________________
Xavier Miller
(FR) Merci de respecter les règles du forum.
http://www.xaviermiller.be
Back to top
View user's profile Send private message
augustin2
Apprentice
Apprentice


Joined: 16 Mar 2012
Posts: 164
Location: France

PostPosted: Wed Jan 22, 2014 3:56 pm    Post subject: Reply with quote

apache2 use flag is enabled globally in make.conf
and I added php flag to apache in /etc/portage/package.use
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


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

PostPosted: Wed Jan 22, 2014 6:37 pm    Post subject: Reply with quote

? profit....

its a bug, i have no idea how big or wide spread it is, where it crept in or what. seems like this was not a problem a year ago. it became a problem approximately 3 months ago.

apparently you're supposed to eselect php list apache2 & set that. i don't think its linking the 70 mod php correctly.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
http://ecx.images-amazon.com/images/I/81Ku-vxIb3L._SL1500_.jpg
http://wiki.gentoo.org/wiki/Special:Contributions/666threesixes666
Back to top
View user's profile Send private message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 874
Location: USA

PostPosted: Fri Jan 31, 2014 9:51 pm    Post subject: Reply with quote

666threesixes666 wrote:
does /etc/apache2/modules.d/70_mod_php5.conf say


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>


try writing it as

/var/www/localhost/htdocs/index.php with

<?php
phpinfo();
?>

& go to localhost/index.php

instead.

if all that matches and still does not work, see troubleshooting article on wiki.gentoo.org and past more information about your setup.
This worked! thx!
_________________
cya
    ©®0t
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