September 13, 2016

How to Install PHP 5.4, 5.5 or 5.6 on CentOS 6 and CentOS 7



Repo Installation
SSH connection to your server and run the following commands 
For CentOS 7 (including EPEL install)



#wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
#wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
#rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm
If you already have EPEL installed:


#rpm -Uvh remi-release-7*.rpm
For CentOS 6 (including EPEL install)



#rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
If you already have EPEL installed:


#rpm -Uvh remi-release-6*.rpm
Enabling the Repo
# vi /etc/yum.repos.d/remi.repo.
We need to make sure that the first section [remi] is enabled:







[remi]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
enabled=1
gpgcheck=1
If we want PHP 5.5 or PHP 5.6 we need to do a bit more work, further down in the repo.repo file you will see two additional sections [remi-php55] and [remi-php56], decide which PHP version you want to install and then enable the correct. So for PHP 5.6 we would change to:








[remi-php56]
name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - $basearch
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
Once you made your changes save your modified file and quit your editor.
Installing PHP



#sudo yum -y install httpd mysql mysql-server mysql-devel php php-mysql php-fpm
#service httpd restart
#php-v


Enjoyed!

Related Posts:

  • Cài VPN bằng OpenVPN trên VPS CentOSVPN là gì ?VPN viết tắt của Virtual Private Network ( mạng riêng ảo )Là một dạng kết nối an toàn, khi thực hiện kết nối VPN thì thông thường toàn bộ kết nối internet trên thiết bị cùa bạn sẽ được chuyển hướng tới 1 máy chủ VP… Read More
  • Hướng dẫn xóa phân vùng swap trên CentOS 6 Removing Swap Space Sometimes it can be prudent to reduce swap space after installation. For example, say you downgraded the amount of RAM in your system from 1 GB to 512 MB, but there is 2 GB of swap space still assi… Read More
  • TỔNG HỢP CÁC LỆNH CHỈNH GIỜ TRÊN CENTOS ​ Xem ngày trên Centos#dateCách set time zone qua GTM+7 (Asia/Ho_Chi_Minh):# ln -f -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtimeĐồng bộ giờ về NTP server Viet Nam (ICT)# ntpdate vn.pool.ntp.org (Muốn đồng bộ ch… Read More
  • How To Fix NIC Link is Down On Centos 6.5 After Upgrade Since upgrading a CentOS 6.4 with a SuperMicro X8SIE-F/X9SCL board with Intel82574L NIC to 2.6.32-431.el6.x86_64 and rebooting, I have been having consistent NIC failures where the NIC shuts down permanently u… Read More
  • Hướng dẫn tạo file swap trên CentOS 6 Trong bài trước mình đã viết hướng dẫn chi tiết cách tạo file swap trên Ubuntu, trên CentOS thì các thao tác cũng tương tự như vậy. Kiểm tra file swap Trước khi tiến hành tạo file swap cần kiểm tra xem hiện tại hệ th… Read More

0 comments:

Post a Comment