linux安装php7.1与composer

1 安装php

1.1 安装依赖包

yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

1.2 下载安装包

cd /usr/local
wget https://www.php.net/distributions/php-7.1.31.tar.gz

1.3 解压

tar -zxvf php-7.1.31.tar.gz

1.4 检查当前的环境是否满足要安装软件的依赖关系

cd php-7.1.31

 

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-mbstring --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --without-pear  --disable-phar --enable-sockets --with-freetype-dir=/usr --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib --with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli --with-curl

1.5 编译安装

make
make install

linux安装php7.1与composer 

1.6 在之前编译的源码包中,找到 php.ini-production,复制到/usr/local/php下,并改名为php.ini

cp php.ini-production /usr/local/php/php.ini

 [可选项] 设置让PHP错误信息打印在页面上

vim /usr/local/php/php.ini 

 linux安装php7.1与composer将Off改成On

linux安装php7.1与composer如果是这样就不用改

1.7 复制启动脚本

启动脚本目录:  /usr/local/php-7.1.31/sapi/fpm/init.d.php-fpm/

cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm

 修改php-fpm配置文件

cd /usr/local/php/etc

 linux安装php7.1与composer

cp php-fpm.conf.default php-fpm.conf

 

vim php-fpm.conf

 

 

https://www.cnblogs.com/houss/p/11296285.html

上一篇:ubuntu下编译安装 PHP 7.3的过程步骤


下一篇:php-fpm linux环境使用exec函数调用ffmpeg,报错ffmpeg: command not found的解决方法