centos 7 中用yum安装 php 7.0
来源:互联网 发布:策略限制网络 编辑:程序博客网 时间:2024/06/09 18:34
转载自https://webtatic.com/packages/php70/
PHP 7.0 on CentOS/RHEL 6.8 and 7.3 via Yum
PHP 7.0.18 has been released on PHP.net on 13th April 2017, and is also available for CentOS/RHEL 6.8 and 7.3 at Webtatic via Yum.
Source - Issues
PEAR installer now supports PHP 7.0, however most pecl libraries will not support it as well without their maintainers adding compatibility, so only pecl libraries that do support it will be in the Webtatic repository.
- pecl memcache extension - no sign of PHP 7 support development in official source repository
Update 2016-12-17 - Webtatic now has released PHP 7.1.0 for CentOS/RHEL 6 and 7
PHP 7.0.0 comes with new version of the Zend Engine with features such as (incomplete list):
- Improved performance: PHP 7 is up to twice as fast as PHP 5.6
- Consistent 64-bit support
- Many fatal errors are now Exceptions
- Removal of old and unsupported SAPIs and extensions
- The null coalescing operator (??)
- Combined comparison Operator (<=>)
- Return Type Declarations
- Scalar Type Declarations
- Anonymous Classes
To see what else has been added, check out the Migrating from PHP 5.6.x to PHP 7.0.x.
To install, first you must add the Webtatic EL yum repository information corresponding to your CentOS/RHEL version to yum:
CentOS/RHEL 7.x:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
CentOS/RHEL 6.x:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpmrpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Now you can install PHP 7.0’s mod_php SAPI (along with an opcode cache) by doing:
yum install php70w php70w-opcache
You can alternatively install PHP 7.0’s php-fpm SAPI (along with an opcode cache by doing:
yum install php70w-fpm php70w-opcache
See the package list below for additional SAPIs and PHP extensions.
This will install the mod_php SAPI for PHP, however there are other sapis such as php-fpm (via php70w-fpm package). Read on below for more information about the available SAPIs
If you would like to upgrade php to this version it is recommended that you first check that your system will support the upgrade, e.g. making sure any CPanel-like software can run after the upgrade.
Unless you know what you are doing, it is risky upgrading an existing system. It’s much safer to do this by provisioning a separate server to perform the upgrade as a fresh install instead.
If you know what you are doing, you can upgrade PHP by:
yum install yum-plugin-replaceyum replace php-common --replace-with=php70w-common
It will likely give you a message “WARNING: Unable to resolve all providers …“. This is normal, and you can continue by tying “y”. You will be given a chance to see what packages will be installed and removed before again being given a chance to confirm.
SAPIs
SAPIs are different runtime environments of PHP.
- mod_php NTS
(non-thread safety) Contained in the php70w package, this SAPI integrates into 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 default mode httpd is ran under. It is not thread-safe, but doesn’t need to be due to prefork not using threads. It’s located at /usr/lib[64]/httpd/modules/libphp7.so
- cli
Contained in the php70w-cli package, this SAPI allows running scripts from the command-line, and also has a built-in web server for development-use. Located at /usr/bin/php
- fpm
Contained in the php70w-fpm package, fpm (FastCGI Process Manager) is a scalable FastCGI process, which acts similar to 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 php70w-phpdbg package, phpdbg has the ability to debug scripts using breakpoints from the command-line, and also supports remote-debugging using an external Java client for remote communication.
- embedded
Contained in the php70w-embedded package, this SAPI allows embedding PHP in other applications. It’s library is located at /usr/lib[64]/libphp7.so
- cgi, fastcgi
Contained in the php70w-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 php70w package, this SAPI integrates into Apache 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 to be thread-safe, but can’t guarantee to be, and certainly not under additional PHP extensions. It’s better to use FastCGI SAPIs than this one. It’s located at /usr/lib[64]/httpd/modules/libphp7-zts.so
Packages
Opcode Caches
The PHP distribution now comes with an opcode cache. This is the Zend Optimizer+ opcode cache, now known as the Zend OPcache extension. This extension is optional, so does not preclude you from using an alternate one.
Due to it being included in the PHP source distribution, it will be well maintained and more suitable for use while other Opcode cache’s are being updated over the coming months.
yum install php70w-opcache
error_reporting E_ALL includes E_STRICT
As mentioned in the PHP 5.4 guide:
You may get a lot more errors coming out of your error logs if by default your error_reporting is set to E_ALL now without explicitly turning off E_STRICT. The default php.ini that comes with the PHP package turns this off by default, but if you are upgrading from an existing installation, your php.ini may not be updated, meaning this will likely be turned on.
- centos 7 中用yum安装 php 7.0
- centos 7 yum安装php
- centos yum安装php
- centos 5.3中用yum安装MPlayer
- Centos 7 安装yum
- CentOS 7.0 yum安装Apache、PHP和MySQL
- CentOS 7.0 yum安装Apache、PHP和MySQL
- CentOS 7.0 yum安装Apache、PHP和MySQL
- centos 7 yum 安装LAMP服务器 Apache PHP MariaDB
- centos 7.0 使用yum 安装 mysql5.7
- centos yum安装php+mysql+apache
- centos yum安装php+mysql+apache
- CentOS,yum,指定php,mysql,版本安装
- CentOS下YUM安装apache+php+mysql
- CentOS中使用yum安装php环境
- CentOS yum安装Apache + PHP + MySQL + Tomcat
- centos yum安装 nginx +php+fastcgi
- Centos yum 安装nginx+php+mysql
- c#中获取服务器IP,客户端IP以及Request.ServerVariables详细说明-->防止SQL的注入
- 给Extjs的GridPanel增加“合计”行
- Java内存模型(JMM)
- 面向对象
- Java面向对象设计模式(十九)——备忘录模式(Memento)
- centos 7 中用yum安装 php 7.0
- Java 9 中的 9 个新特性
- android 模拟阴影
- 学习正则表达式
- Handler,Message,MessageQuene三者不得不说的故事
- Java 集合之List 集合的删除方法顺序分析以及remove和removeAll区别
- 指针和数组间的不明关系
- Data Types
- allegro学习之绘制板框倒角出问题及解决