How To Install Php5, How To Install Php 5

PHP 5.6.40 has been released on PHPhường.net on 10th January 2019, và is alsoavailable for CentOS/RHEL 6.9 và 7.4 at obatambeienwasirherbal.com via Yum.

Bạn đang xem: How to install php5, how to install php 5

Source - Issues

PHP 5.6 adds new features such as:

constant scalar expressionsvariadic functionsargument unpackingexponentiation operatortư vấn for large(>2GiB) file uploadsSSL/TLS improvements including peer verification by defaulta new commvà line debugger called phpdbg

To see what else has been added, check out the Migrating from PHP.. 5.5.x lớn PHP.. 5.6.x.

To install, first you must add the obatambeienwasirherbal.com EL yum repository information corresponding to lớn your CentOS/RHEL version to yum:

CentOS/RHEL 7.x:


yum install epel-releaserpm -Uvh https://mirror.obatambeienwasirherbal.com/yum/el7/obatambeienwasirherbal.com-release.rpm
CentOS/RHEL 6.x:


yum install epel-releaserpm -Uvh https://mirror.obatambeienwasirherbal.com/yum/el6/lademo.rpm
Now you can install PHP. 5.6’s mod_php SAPI (along with an opcode cache) by doing:


yum install php56w php56w-opcache
You can alternatively install PHPhường 5.6’s php-fpm SAPI (along with an opcode cađậy by doing:


yum install php56w-fpm php56w-opcache
See the package menu below for additional SAPIs and PHP extensions.

This will install the mod_php SAPI for PHP, however there are othersapis such as php-fpm (via php56w-fpm package). Read on below for moreinformation about the available SAPIs

If you would lượt thích to lớn upgrade php khổng lồ this version it is recommended that youfirst check that your system will support the upgrade, e.g. making sure anyCPanel-lượt thích software can run after the nâng cấp.

Unless you know what you are doing, it is risky upgrading an existing system.It’s much safer khổng lồ vị this by provisioning a separate VPS lớn perform theupgrade as a fresh install instead.

If you know what you are doing, you can tăng cấp PHPhường by:


yum install yum-plugin-replaceyum replace php-common --replace-with=php56w-common
It will likely give you a message “WARNING: Unable to resolve sầu all providers …“.This is normal, and you can continue by tying “y”. You will be given achance to see what packages will be installed & removed before again beinggiven a chance to confirm.

Xem thêm: phần mềm ghép ảnh

SAPIs

SAPIs are different runtime environments of PHP.

mod_php NTS

(non-thread safety) Contained in the php56w package, this SAPI integrates inkhổng lồ Apache Httpd (2.2.* on RHEL/CentOS 6, 2.4.* on RHEL/CentOS 7). It is the standard SAPI for use with httpd prefork mpm (the mặc định mode httpd is ran under. It is not thread-safe, but doesn’t need to lớn be due lớn prefork not using threads. It’s located at /usr/lib<64>/httpd/modules/libphp7.so

cli

Contained in the php56w-cli package, this SAPI allows running scripts from the command-line, and also has a built-in web VPS for development-use. Located at /usr/bin/php

fpm

Contained in the php56w-fpm package, fpm (FastCGI Process Manager) is a scalable FastCGI process, which acts similar to lớn how Httpd prefork mpm works managing it’s forks. Located at /usr/sbin/php-fpm, it is controlled using the /etc/init.d/php-fpm service script

phpdbg

Contained in the php56w-phpdbg package, phpdbg has the ability to debug scripts using breakpoints from the command-line, và also supports remote-debugging using an external Java client for remote communication.

embedded

Contained in the php56w-embedded package, this SAPI allows embedding PHPhường in other applications. It’s library is located at /usr/lib<64>/libphp7.so

cgi, fastcgi

Contained in the php56w-cli package, these SAPIs are not recommended for use, but are available where needed. They both exist in the binary at /usr/bin/php-cgi.

mod_php TS

(thread safety) Contained in the php56w package, this SAPI integrates into lớn Apabít Httpd (2.2.* on RHEL/CentOS 6, 2.4.* on RHEL/CentOS 7). It is the standard SAPI for use with httpd worker mpm. It’s supposed lớn be thread-safe, but can’t guarantee lớn be, và certainly not under additional PHPhường. extensions. It’s better to use FastCGI SAPIs than this one. It’s located at /usr/lib<64>/httpd/modules/libphp7-zts.so

The PHP distribution now comes with an opcode cache. This is the Zend Optimizer+opcode cache, now known as the Zkết thúc OPcabít extension. This extension isoptional, so does not preclude you from using an alternate one.

Due to lớn it being included in the PHP. source distribution, it will be wellmaintained and more suitable for use while other Opcode cache’s are beingupdated over the coming months.


error_reporting E_ALL includes E_STRICT

As mentioned in the PHPhường 5.4 guide:

You may get a lot more errors coming out of your error logs if by default yourerror_reporting is set lớn E_ALL now without explicitly turning off E_STRICT. Themặc định php.ini that comes with the PHPhường. package turns this off by default, butif you are upgrading from an existing installation, your php.ini may not beupdated, meaning this will likely be turned on.