Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP 5.6 and PHP 7
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
augustin
Guru
Guru


Joined: 23 Feb 2015
Posts: 318

PostPosted: Thu Feb 23, 2017 3:46 pm    Post subject: PHP 5.6 and PHP 7 Reply with quote

I just saw that PHP 7 is currently being pushed on stable amd64, upgrading from PHP 5.6.
I have critical legacy software that will certainly break with PHP 7.

I saw the documentation on the wiki:
Running multiple versions of PHP
https://wiki.gentoo.org/wiki/PHP#Running_multiple_versions_of_PHP
I added to make.conf:
Code:

PHP_TARGETS="php5-6 php7-0"


Now when I emerge update, I get, among other things:
Code:

[ebuild  NS    ]  virtual/httpd-php-7.0 [5.6]
[ebuild  NS    ] dev-lang/php-7.0.15 [5.6.30] USE="acl apache2 berkdb bzip2 cjk cli crypt ctype curl exif fileinfo filter fpm gd gdbm hash iconv ipv6 json ldap mysql mysqli nls opcache phar posix readline session simplexml spell ssl tokenizer truetype unicode xml xslt zlib -bcmath -calendar -cdb -cgi -coverage -debug -embed -enchant (-firebird) -flatfile -ftp -gmp -imap -inifile -intl -iodbc -kerberos -ldap-sasl -libedit (-libressl) -mhash -mssql -oci8-instant-client -odbc -pcntl -pdo -phpdbg -postgres -qdbm -recode (-selinux) -sharedmem -snmp -soap -sockets -sqlite -systemd -sysvipc -threads -tidy -wddx -webp -xmlreader -xmlrpc -xmlwriter -xpm -zip"
[ebuild   R    ] dev-php/pecl-geoip-1.1.1-r2  PHP_TARGETS="php7-0*"


the emerge man page says:
Code:

       [ebuild NS ] dev-libs/glib-2.4.7
              You already have a version of glib installed, but a 'new' version in a different SLOT is available.


I am not totally clear what it exactly means.
Does "[ebuild NS ] dev-lang/php-7.0.15 [5.6.30] " actually mean that PHP 7.0 will be installed alongside 5.6?
I am safe to go?

I guess then I use eselect php list apache2 to select the php version to run with Apache.
Can't apache run with both, with the exact handler to be used being configured in the vhosts settings?
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Thu Feb 23, 2017 4:05 pm    Post subject: Reply with quote

N means it's a new package.
S means it's a slotted package.

So yes, you are safe to go. You can do emerge -p --depclean to check if the system is going to try to remove something. If that's the case you need to review your settings again.

About apache2 per-vhost settings: Can't help you there.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Feb 24, 2017 10:28 pm    Post subject: Re: PHP 5.6 and PHP 7 Reply with quote

augustin wrote:
Can't apache run with both, with the exact handler to be used being configured in the vhosts settings?

Apache has no problem talking to multiple concurrent versions of PHP. Just use ProxyPassMatch to point at the php-fpm socket, you can set a different one per-<Location> if need be.
Back to top
View user's profile Send private message
augustin
Guru
Guru


Joined: 23 Feb 2015
Posts: 318

PostPosted: Sat Feb 25, 2017 1:33 am    Post subject: Reply with quote

Thank you both. I'll set some time aside to proceed with the upgrade. Thanks. :)
Back to top
View user's profile Send private message
augustin
Guru
Guru


Joined: 23 Feb 2015
Posts: 318

PostPosted: Tue Mar 07, 2017 2:56 am    Post subject: Reply with quote

Thanks again.

PHP 7.0 was emerged smoothly.
By default, everything still uses 5.6, so nothing broke! :)


Quote:
# eselect php list cli
[1] php5.6 *
[2] php7.0
# eselect php list apache2
[1] php5.6 *
[2] php7.0


I can now take my time to slowly test PHP 7.0 on selected web sites.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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