Linux 安装php7
2021-01-30 06:13
标签:linux pat ref tar www serve type client pdo 1.安装依赖包 2.下载安装包 3.解压 4.这里只打开fpm、安装mysqli驱动包,有需求可自行加入依赖包 5.编译安装 6.在之前编译的源码包中,找到 php.ini-production,复制到/usr/local/php下,并改名为php.ini: 7.复制启动脚本 修改php-fpm配置文件: 去掉 pid = run/php-fpm.pid 前面的分号 拷贝www.conf文件 8.启动PHP 查看是否已经成功启动PHP 9.开机自启动 将 /etc/init.d/php-fpm start 添加到rc.local文件里面 10.大功告成! Linux 安装php7 标签:linux pat ref tar www serve type client pdo 原文地址:https://www.cnblogs.com/front-web/p/14338833.htmlyum 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
cd /usr/local
wget https://www.php.net/distributions/php-7.1.31.tar.gz
tar -zxvf php-7.1.31.tar.gz
cd php-7.1.31
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-fpm --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
make
make install
cp php.ini-production /usr/local/php/php.ini
cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
cd /usr/local/php/etc
cp php-fpm.conf.default php-fpm.conf
vi php-fpm.conf
cd php-fpm.d
cp www.conf.default www.conf
/etc/init.d/php-fpm start #php-fpm启动命令
/etc/init.d/php-fpm stop #php-fpm停止命令
/etc/init.d/php-fpm restart #php-fpm重启命令
ps -ef | grep php
vi /etc/rc.local
chmod +x /etc/rc.d/rc.local