December 23, 2015

HOW TO UPGRADE PHP 5.3.X TO 5.4.X OR 5.5.X ON CENTOS

This tutorial was performed on CentOS 6.5 x86 (32-bit) vps.
Step 1 – Login to your server via Command Line (Putty or Terminal)
Step 2 – Add EPEL and Remi repositories onto your system:
On CentOS 6.x 32-bit
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
On CentOS 6.x x86_64 (64-bit)
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
screenshot:

upgrade-php-centos-1
Step 3 – Now enable your newly added Remi repo. Open the /etc/yum.repos.d/remi.reporepository file using a text editor of your choice – I use Nano:
nano /etc/yum.repos.d/remi.repo
Step 4 – Edit enabled=0 line to enabled=1:
4.a – Update to PHP 5.4, in [remi] section:

upgrade-php-centos-4
4.b – Update to PHP 5.5, in [remi-php55] section:

upgrade-php-centos-4b
4.c – Bonus – Update to PHP 5.6 (beta version), in [remi-php56] section:

upgrade-php-centos-4c
once done, Save changes (Control+O) and exit (Control+X)
Step 5 – Now update yum:
yum update -y
upgrade-php-centos-5
Step 6 – Done. Now you can check using this command:
php -v
In this example I got:
PHP 5.4.28

upgrade-php54-centos
PHP 5.5.12

upgrade-php55-centos
PHP 5.6.0 Beta 2

upgrade-php56-centos
Now you can test your PHP script on your browser and hope everything still runs smoothly.

PREVENTING THE MESS

You may have to edit old httpd.conf and php.conf (if your srcipt went messed up).
Step 1 – Make backup of php.conf file:
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf.bak
Step 2 – Then edit httpd.conf  file:
nano /etc/httpd/conf/httpd.conf
Step 3 – You have to find every line with php_ in it, and remove it (or simply add #). If you have found out that there is at least one line per domain, so be sure to remove them all. Once done, save and exit.
Step 4 – Finally restart httpd service (Apache):
service httpd restart
Also, you may also want to upgrade MySQL using this command:
mysql_upgrade -u root -p
source: http://www.servermom.org/upgrade-php-53-54-55-centos/1534/

Related Posts:

  • 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
  • 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
  • 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
  • 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
  • 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

0 comments:

Post a Comment