Friday, February 19, 2016

linux - PHP upgrade fails, CentOS 6.7



System information



Operating system CentOS Linux 6.7




Kernel and CPU Linux 2.6.32-042stab108.1 on x86_64



yum repolist enabled


only ones i added manually






  • base - CentOS-6 -

  • Base epel - Extra Packages for Enterprise Linux 6 - x86_64

  • extras - CentOS-6 - Extras

  • ius - IUS Community Packages for Enterprise Linux 6 - x86_64

  • mod-pagespeed - mod-pagespeed

  • remi-safe - Safe Remi's RPM repository for Enterprise Linux 6 - x86_64

  • rhscl-php55-epel-6-x86_64 - PHP 5.5.21 -

  • epel-6-x86_64 updates - CentOS-6 - Updates

  • virtualmin - RHEL/CentOS/Scientific 6 - x86_64 -

  • Virtualmin virtualmin-universal - Virtualmin Distribution Neutral


  • Packages vz-base - vz-base vz-updates - vz-updates




available installed versions




  • /usr/bin/php 5.3.3

  • /usr/bin/php55 5.5.30







i tried the following (using virtualmin)




  1. enabled 5.5.30 for a specific directory and that didn't worked out got this error from virtualmin This virtual server is using the mod_php execution mode for PHP, such does not allow per-directory version selection.

  2. enabled the directory specific version home//domains/..com/public_html/public , and phpinfo(); returns 5.3.3 version

  3. tried yum replace php-common --replace-with=php55-php-common got too many packages in WARNING: Unable to resolve all providers and didn't proceed.

  4. tried to remove version 5.3 but other php code breaks that's why i hesitate replacing that version


  5. Browsed the web for answers only to find out that more than half of the things i read are broken, repositories outdated or conflicting with other packages when i try to yum upgrade php



Can someone please help with this frustrating situtation? i really thought that installing another version and enabling it for a directory would solve this problem.


Answer



We recommend you use SCL versions of packages, so that the PHP versions can co-exist peacefully with each other and not cause the conflicts you're running into. I've got Remi's PHP 5.6.15 packages running on our new server, under Virtualmin, and it's working fine (I did have to tweak the detection code in php-lib.pl, though that won't be needed in a few days when new Virtualmin comes out).



Also, you should use the fcgid execution mode, and not mod_php. mod_php can only exist in one version in a single Apache instance and will never work with multiple versions. fcgid is the default execution mode in a Virtualmin system installed with install.sh, but it is configurable in System Settings:Server Templates:Template Name:Apache Website. "Default PHP execution mode" is the option you want, and FCGId is the right value for using multiple PHP versions (and for a variety of other good reasons).



Current version of Virtualmin doesn't support all of the SCL PHP packages, yet, but the next version will handle arbitrary versions easily (and will likely have the ability to query the SCL command to figure out what your preferred PHP version is; I don't know how much of that has been implemented yet).




There has been quite a bit of discussion about this subject in our forums over the past few weeks, as SCL has gotten more PHP versions, and as Virtualmin support for SCL packages has been expanded.



There's some docs here (which I'm not sure if Eric has updated yet, to address recent changes in SCL, but they will be soon if not already):



http://www.virtualmin.com/documentation/web/multiplephp


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...