Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP broken since php 7.0 install [SOLVED]
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
binro
l33t
l33t


Joined: 06 May 2005
Posts: 623
Location: Bangkok, Thailand

PostPosted: Thu Dec 31, 2015 2:09 pm    Post subject: PHP broken since php 7.0 install [SOLVED] Reply with quote

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
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5592

PostPosted: Thu Dec 31, 2015 3:59 pm    Post subject: Re: PHP broken since php 7.0 install Reply with quote

binro wrote:
What have I missed?

Error logs, maybe? :roll:
Back to top
View user's profile Send private message
binro
l33t
l33t


Joined: 06 May 2005
Posts: 623
Location: Bangkok, Thailand

PostPosted: Fri Jan 01, 2016 2:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5592

PostPosted: Fri Jan 01, 2016 11:38 pm    Post subject: Reply with quote

That's a problem then. Does anything out of the ordinary get logged when you restart apache?
Back to top
View user's profile Send private message
binro
l33t
l33t


Joined: 06 May 2005
Posts: 623
Location: Bangkok, Thailand

PostPosted: Sat Jan 02, 2016 1:49 pm    Post subject: Reply with quote

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


Joined: 27 Sep 2005
Posts: 1692

PostPosted: Sat Jan 02, 2016 3:58 pm    Post subject: Reply with quote

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
Code:
libphp7.so
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
View user's profile Send private message
binro
l33t
l33t


Joined: 06 May 2005
Posts: 623
Location: Bangkok, Thailand

PostPosted: Sun Jan 03, 2016 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
juergen-ger
n00b
n00b


Joined: 04 Jan 2016
Posts: 2
Location: Germany

PostPosted: Mon Jan 04, 2016 5:02 pm    Post subject: Reply with quote

See this bug https://bugs.gentoo.org/show_bug.cgi?id=569042
The same here.Downgrade to app-eselect/eselect-php-8.0 works for me.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1692

PostPosted: Mon Jan 04, 2016 7:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
juergen-ger
n00b
n00b


Joined: 04 Jan 2016
Posts: 2
Location: Germany

PostPosted: Mon Jan 04, 2016 7:32 pm    Post subject: Reply with quote

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


Joined: 06 May 2005
Posts: 623
Location: Bangkok, Thailand

PostPosted: Mon Jan 04, 2016 8:10 pm    Post subject: Reply with quote

juergen-ger wrote:
See this bug https://bugs.gentoo.org/show_bug.cgi?id=569042
The same here.Downgrade to app-eselect/eselect-php-8.0 works for me.

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. :D
_________________
"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
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