View previous topic :: View next topic |
Author |
Message |
augustin Guru
Joined: 23 Feb 2015 Posts: 318
|
Posted: Thu Feb 23, 2017 3:46 pm Post subject: PHP 5.6 and PHP 7 |
|
|
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 |
|
|
saboya Guru
Joined: 28 Nov 2006 Posts: 552 Location: Brazil
|
Posted: Thu Feb 23, 2017 4:05 pm Post subject: |
|
|
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 |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Fri Feb 24, 2017 10:28 pm Post subject: Re: PHP 5.6 and PHP 7 |
|
|
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 |
|
|
augustin Guru
Joined: 23 Feb 2015 Posts: 318
|
Posted: Sat Feb 25, 2017 1:33 am Post subject: |
|
|
Thank you both. I'll set some time aside to proceed with the upgrade. Thanks. |
|
Back to top |
|
|
augustin Guru
Joined: 23 Feb 2015 Posts: 318
|
Posted: Tue Mar 07, 2017 2:56 am Post subject: |
|
|
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 |
|
|
|