Installing PHP 5.6.x on CentOS 5.11
Joe • December 8, 2015
devops linux phpInstall Nginx, PHP 5.6.15 and PHP-FPM on CentOS 5.11
I know... I know.
But I had to figure it out. So here's what made it happen:
Starting Point:
# cat /etc/redhat-release
CentOS release 5.11 (Final)
# php -v
PHP 5.1.6 (cli) (built: Nov 6 2014 12:25:07)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
Install Extra Repos:
## Remi Dependency on CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
## CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
Enable Repos and install nginx and php:
yum install php-pear
yum install php-pecl-json
yum -- enablerepo=remi,remi-php56 install nginx php-fpm php-common
yum -- enablerepo=remi,remi-php56 install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-pecl-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
I had to install php-pear and php-pecl-json before the big install because I was getting warnings:
--> Finished Dependency Resolution
php-pecl-json-1.2.1-4.el5.x86_64 from epel has depsolving problems
-- > Missing Dependency: php-api = 20041225 is needed by package php-pecl-json-1.2.1-4.el5.x86_64 (epel)
php-pecl-json-1.2.1-4.el5.x86_64 from epel has depsolving problems
-- > Missing Dependency: php-api = 20041225 is needed by package php-pecl-json-1.2.1-4.el5.x86_64 (epel)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-json-1.2.1-4.el5.x86_64 (epel)
You could try using -- skip-broken to work around the problem
You could try running: package-cleanup -- problems
package-cleanup -- dupes
rpm -Va -- nofiles -- nodigest
Final Result:
# php -v
PHP 5.6.16 (cli) (built: Nov 26 2015 08:10:10)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
Your milage may vary. I hope no one ever needs this.
As Seen On
Recent Posts
- PHP to Rust via Copilot
- Compiling Python 3.12 from Source Tarball on Linux
- HTML Form Processing with PHP - php[architect] Magazine August 2014
- The Workshop: Local Dev with Lando - php[architect] Magazine November 2022
- Getting back into the swing of things
- All Posts
Categories
- ansible
- apache
- applesilicon
- aws
- blackwidow
- cakephp
- community
- composer
- conferences
- copilot
- data-storage
- day-job
- devops
- docker
- fpv
- general
- github
- givecamp
- homestead
- jigsaw
- joindin
- keyboard
- laravel
- learning
- linux
- maker
- mamp
- mentoring
- music
- nonprofit
- opensource
- packages
- php
- phparch
- projects
- provisioning
- python
- razer
- rust
- s3
- security
- slimphp
- speaking
- static-sites
- storage
- testing
- tiny-whoop
- today-i-learned
- training
- ubuntu
- vagrant
- version-control
- windows
- writing
- wsl
- wsl2
- zend-zray