php的安装部署及其优化
一、PHP源码编译
软件下载:https://www.php.net/
软件编译:
#step1: tar jxf php-7.4.6.tar.bz2
# cd php-7.4.6
# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-iconv --with-mhash --with-zlib --with-openssl --enable-mysqlnd --with-mysqli --with-pdo-mysql --disable-debug --enable-sockets --enable-soap --enable-inline-optimization --enable-xml --enable-ftp --enable-gd --enable-exif --enable-mbstring --enable-bcmath --with-fpm-systemd
# make
# make install
(1)首先 进行configure 这个过程会遇到大量的报错,无非是缺少东西,缺啥咱下载啥就行了,如下图所示:
下图中缺少的文件,去阿里云上直接下载就行了:
(2)进行make 和 make install
二、启动php
(1)添加环境变量:
vim ~/.bash_profile
PATH= P A T H : PATH: PATH:HOME/bin:/usr/local/php/bin
source ~/.bash_profile
测试效果如下所示:
.
(2)修改配置文件
step1:
step2:
step3: