php7.4編譯(centos)


1 下載包放到家目錄

[root@centos ~]# ls
php-7.4.0.tar.xz

2 解壓並安裝編譯需要的工具
[root@centos ~]# yum install gcc pcre-devel openssl-devel expat-devel autoconf libtool gcc-c++ libsqlite3x-devel (后面編譯差什么包就 yum install XXX-devel -y)

3 解壓進到目錄
[root@centos ~]# tar xf php-7.4.0.tar.xz
[root@centos ~]# cd php-7.4.0
[root@centos ~]# ./configure --prefix=/data/php --enable-fpm --with-fpm-user=www
--with-fpm-group=www --with-pear --with-curl --with-png-dir --with-freetype-dir --
with-iconv --with-mhash --with-zlib --with-xmlrpc --with-xsl --with-openssl --
with-mysqli --with-pdo-mysql --disable-debug --enable-zip --enable-sockets --enablesoap
--enable-inline-optimization --enable-xml --enable-ftp --enable-exif --enablewddx
--enable-bcmath --enable-calendar --enable-shmop --enable-dba --enable-sysvsem -
-enable-sysvshm --enable-sysvmsg

4 make~~~
[root@centos ~]# make && make install

5 配置環境和文件
[root@centos ~]# cd /data/php/etc/php-fpm.d/
[root@centos php-fpm.d]# cp www.conf.default www.conf
[root@centos php-fpm.d]# cp /root/php7.4.0/php.ini-development /data/php/etc/php.ini
[root@centos php-fpm.d]# cd ..
[root@centos etc]# ls
php-fpm.conf.default php-fpm.d php.ini
[root@centos etc]# cp php-fpm.conf.default php-fpm.conf
[root@centos etc]# useradd -r -s /sbin/nologin -u 1001 www
[root@centos etc]# vim php-fpm.d/www.conf (更改啟動用戶 user group)
[root@centos etc]# cd../sbin
[root@centos sbin]# ./php-fpm

6 查看運行
[root@centos sbin]# ps -ef | grep www
www 28944 28943 0 18:27 ? 00:00:00 php-fpm: pool www
www 28945 28943 0 18:27 ? 00:00:00 php-fpm: pool www


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM