php源码安装

下载php的rpm包并解压
在解压之后的目录中,查看是否有configure,如果有此文件,使用./configure--->make---->make install方式进行源码安装

[root@server1 ~]# yum install -y bzip2
[root@server1 ~]# tar jxf php-7.4.12.tar.bz2
[root@server1 ~]# ls
[root@server1 ~]# cd php-7.4.12/
[root@server1 php-7.4.12]# ls
[root@server1 php-7.4.12]# ./configure | less
[root@server1 php-7.4.12]# ./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
[root@server1 php-7.4.12]# yum install -y systemd-devel libxml2-devel sqlite-devel libcurl-devel libpng-devel
[root@server1 ~]# yum install -y oniguruma-6.8.2-1.el7.x86_64.rpm
[root@server1 ~]# yum install -y oniguruma-devel-6.8.2-1.el7.x86_64.rpm
 
[root@server1 php-7.4.12]# ./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
[root@server1 php-7.4.12]# make

 

memcache-4.0.5.2.tgz  ##解压 

对memcache进行源码编译
make
make install
cd /usr/local/php/etc/
vim php.ini
systemctl reload php-fpm.service
php -m | grep memcache 

 安装成功

 

 

更多推荐

php源码安装