1 다운로드하여 설치합니다. 종속성
wget http://cn2.php.net/distributions/php-7.0.30.tar.gz 解压 tar -zxvf php-7.0.30.tar.gz
3. php
yum -y install gcc openssl openssl-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel pcre pcre-devel libxslt libxslt-devel bzip2 bzip2-devel
4를 컴파일하고 설치합니다. PHP 관련 파일을 구성합니다
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-pdo-mysql --with-mysqli --with-gd --with-zlib --with-mcrypt --enable-fpm make && make install 安装完成后,别忘记 make test 有如下报错 configure: error: mcrypt.h not found. Please reinstall libmcrypt. 解决 yum install -y epel-release yum install -y libmcrypt-devel 重新编译
5. PHP를 시작하고 설치가 성공했는지 확인합니다.
1)配置php.ini,这是php的配置文件: cp /etc/we/php-7.1.11/php.ini-development /usr/local/php/lib/php.ini 2)配置php-fpm.conf,这是php-fpm配置文件: cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 3)配置www.conf,配置用户的文件: cp etc/php-fpm.d/www.conf.default etc/php-fpm.d/www.conf 4)将php-fpm启动文件复制到init.d文件夹中一份方便启动php: cp /usr/local/php/sbin/php-fpm /etc/init.d/php-fpm추천 학습: "