View previous topic :: View next topic |
Author |
Message |
augustin2 Apprentice
Joined: 16 Mar 2012 Posts: 244 Location: France
|
Posted: Tue Jan 21, 2014 4:19 pm Post subject: [SOLVED] Cannot have php module activated on apache |
|
|
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 |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jan 22, 2014 6:47 am Post subject: |
|
|
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. |
|
Back to top |
|
|
augustin2 Apprentice
Joined: 16 Mar 2012 Posts: 244 Location: France
|
Posted: Wed Jan 22, 2014 8:14 am Post subject: |
|
|
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 |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jan 22, 2014 8:16 am Post subject: |
|
|
"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.
Last edited by 666threesixes666 on Wed Jan 22, 2014 8:17 am; edited 1 time in total |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8709 Location: ~Brussels - Belgique
|
Posted: Wed Jan 22, 2014 8:16 am Post subject: |
|
|
Hello,
Did you enable php support in Apache during emerge ?
can you provide the output of _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
augustin2 Apprentice
Joined: 16 Mar 2012 Posts: 244 Location: France
|
Posted: Wed Jan 22, 2014 11:04 am Post subject: |
|
|
XavierMiller wrote: | Hello,
Did you enable php support in Apache during emerge ?
can you provide the output of |
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 |
|
|
augustin2 Apprentice
Joined: 16 Mar 2012 Posts: 244 Location: France
|
Posted: Wed Jan 22, 2014 12:45 pm Post subject: |
|
|
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 |
|
|
augustin2 Apprentice
Joined: 16 Mar 2012 Posts: 244 Location: France
|
Posted: Wed Jan 22, 2014 1:25 pm Post subject: |
|
|
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 |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8709 Location: ~Brussels - Belgique
|
Posted: Wed Jan 22, 2014 2:07 pm Post subject: |
|
|
did you add apache2 in the php USE flag ? I guess php install the config file only if that USE is enabled. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
augustin2 Apprentice
Joined: 16 Mar 2012 Posts: 244 Location: France
|
Posted: Wed Jan 22, 2014 3:56 pm Post subject: |
|
|
apache2 use flag is enabled globally in make.conf
and I added php flag to apache in /etc/portage/package.use |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Wed Jan 22, 2014 6:37 pm Post subject: |
|
|
? 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. |
|
Back to top |
|
|
Cr0t l33t
Joined: 27 Apr 2002 Posts: 944 Location: USA
|
Posted: Fri Jan 31, 2014 9:51 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|