目录
PHP源码编译
php启动与nginx整合
php功能模块的扩展
php添加memcache功能模块
构建Nginx高速缓存
tomcat结合memcache
PHP源码编译
https://www.php.net 下载软件包
安装解压工具
tar -vxf php-7.4.12.tar.bz2
解压php的压缩包
tar zxf php-7.4.12.tar.bz2
编译,过程中会有许多报错,都是缺少依赖性文件,需要下载,
yum install systemd-devel -y
yum install libxml2-devel.x86_64 -y
yum install sqlite-devel.x86_64 -y
yum install libcurl-devel.x86_64 -y
yum install libpng-devel.x86_64 -y
下面两个文件yum源中没有,可以从阿里云中下载
yum install oniguruma-devel-6.8.2-1.el7.x86_64.rpm oniguruma-6.8.2-1.el7.x86_64.rpm -y
./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
安装完成
php启动与nginx整合
添加环境变量
查看php路径
修改配置文件