View previous topic :: View next topic |
Author |
Message |
binro l33t


Joined: 06 May 2005 Posts: 716 Location: Bangkok, Thailand
|
Posted: Thu Dec 31, 2015 2:09 pm Post subject: PHP broken since php 7.0 install [SOLVED] |
|
|
I have just noticed that no php apps work on my Apache server. PHP7 was recently installed and has been selected and I have updated apache2 options:
Code: |
APACHE2_MODULES="actions alias auth_basic authn_core auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info lbmethod_byrequests log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif slotmem_shm so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias"
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D MANUAL -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -D LANGUAGE -D NAGIOS -D STATUS -D PHP7"
|
I tried reverting to php 5.6 but that didn't help. I also recompiled apache and php with gcc 5.3 which I have just converted to. What have I missed?
TIA _________________ "Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling
Last edited by binro on Mon Jan 04, 2016 8:11 pm; edited 1 time in total |
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 6920
|
Posted: Thu Dec 31, 2015 3:59 pm Post subject: Re: PHP broken since php 7.0 install |
|
|
binro wrote: | What have I missed? |
Error logs, maybe?  |
|
Back to top |
|
 |
binro l33t


Joined: 06 May 2005 Posts: 716 Location: Bangkok, Thailand
|
Posted: Fri Jan 01, 2016 2:34 pm Post subject: |
|
|
The only message is:
Dec 31 23:03:00 opal apache2[4858]: [core:alert] [pid 4858] [client 66.249.71.154:57965] /var/www/localhost/htdocs/phpsyslogng/html/.htaccess:
Invalid command 'php_flag', perhaps
misspelled or defined by a module not included in the server configuration
which apparently means PHP is not loaded. Apart from that you only see see the php source in the browser, it is not executed. _________________ "Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling |
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Jan 01, 2016 11:38 pm Post subject: |
|
|
That's a problem then. Does anything out of the ordinary get logged when you restart apache? |
|
Back to top |
|
 |
binro l33t


Joined: 06 May 2005 Posts: 716 Location: Bangkok, Thailand
|
Posted: Sat Jan 02, 2016 1:49 pm Post subject: |
|
|
Nothing.  _________________ "Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling |
|
Back to top |
|
 |
ct85711 Veteran

Joined: 27 Sep 2005 Posts: 1791
|
Posted: Sat Jan 02, 2016 3:58 pm Post subject: |
|
|
I haven't installed apache and php in a while, but some things you may want to check for is first:
make sure on your system, you have using locate or find will be a easy test to make sure you have that file.
Also, according to php's documentation, in your apache conf's, you should have a line Code: | LoadModule php7_module modules/libphp7.so | somewhere (if it's commented out, it's not enabled)
http://php.net/manual/en/install.unix.apache2.php
Almost forgot, not sure if this also applies for gentoo, but on some other distros, they've been having an issue where the php7 config file was not installed. |
|
Back to top |
|
 |
binro l33t


Joined: 06 May 2005 Posts: 716 Location: Bangkok, Thailand
|
Posted: Sun Jan 03, 2016 2:54 pm Post subject: |
|
|
Code: | locate libphp7.so
/usr/lib64/php7.0/apache2/libphp7.so
|
The module is installed and there is a LoadModule for it (in /var/lib/eselect-php/mod_php.conf because of the eselect mechanism). There is also a /etc/php/apache2-php7.0/php.ini so it all looks good, it just doesn't work. _________________ "Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling |
|
Back to top |
|
 |
juergen-ger n00b

Joined: 04 Jan 2016 Posts: 2 Location: Germany
|
|
Back to top |
|
 |
ct85711 Veteran

Joined: 27 Sep 2005 Posts: 1791
|
Posted: Mon Jan 04, 2016 7:15 pm Post subject: |
|
|
from my understanding from the mailing list linked to the bug report, it mentions instead of doing -D PHP7 or PHP5 try -D PHP instead. |
|
Back to top |
|
 |
juergen-ger n00b

Joined: 04 Jan 2016 Posts: 2 Location: Germany
|
Posted: Mon Jan 04, 2016 7:32 pm Post subject: |
|
|
Right,if you are upgrading.And also "you must run eselect at least once to choose your apache2 target before the new configuration will work." |
|
Back to top |
|
 |
binro l33t


Joined: 06 May 2005 Posts: 716 Location: Bangkok, Thailand
|
Posted: Mon Jan 04, 2016 8:10 pm Post subject: |
|
|
Thank you! I changed APACHE2_OPTS to -D PHP and it all worked again. I fixed it using my phone in a bar, it was that simple. OK, phpsyslog-ng had all sorts of problems with PHP7 but switching back to PHP 5.6 fixed that.
Thanks to all who tried to help.  _________________ "Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling |
|
Back to top |
|
 |
|