vps安装php 7.3,[Centos]编译安装PHP7.3

本文档详细介绍了如何下载并安装PHP7.3.8,包括配置参数、启用FPM、设置权限,以及安装必要的扩展如mysqli、pdo_mysql等。此外,还涉及了php.ini的优化,例如调整post_max_size、upload_max_filesize等,并设置了日期时区、短标签开启等。最后,配置了php-fpm服务,包括监听设置、用户组、进程管理等,并创建了系统服务脚本。
摘要由CSDN通过智能技术生成

#下载地址:http://php.net/

#工具包 git@gitee.com:bbhsky/PHP-Setup.gittar jxvf php-7.3.8.tar.bz2

cd php-7.3.8/

./configure--prefix=/usr/local/php-7.3.8 --with-config-file-path=/usr/local/php-7.3.8/etc--with-config-file-scan-dir=/usr/local/php-7.3.8/conf.d--enable-fpm--with-fpm-user=www--with-fpm-group=www--enable-mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir=/usr/local/libiconv--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local/curl--enable-mbregex--enable-mbstring--enable-intl--enable-pcntl--enable-ftp--with-gd--with-openssl=/usr/local/openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--with-gettext--disable-fileinfo--enable-opcache--with-xsl--with-libzip

make ZEND_EXTRA_LIBS='-liconv' -j`grep 'processor' /proc/cpuinfo | wc -l`make install

ln-sf/usr/local/php-7.3.8 /usr/local/php-7.3ln-sf/usr/local/php-7.3 /usr/local/php-7ln-sf/usr/local/php-7 /usr/local/php

ln-sf/usr/local/php/bin/php/usr/bin/php

ln-sf/usr/local/php/bin/phpize/usr/bin/phpize

ln-sf/usr/local/php/bin/pear/usr/bin/pear

ln-sf/usr/local/php/bin/pecl/usr/bin/pecl

ln-sf/usr/local/php/sbin/php-fpm/usr/bin/php-fpm

mkdir-p/usr/local/php/conf.d

mkdir-p/usr/local/php/etc

cp php.ini-production/usr/local/php/etc/php.ini

sed-i's/post_max_size =.*/post_max_size = 50M/g' /usr/local/php/etc/php.ini

sed-i's/upload_max_filesize =.*/upload_max_filesize = 50M/g' /usr/local/php/etc/php.ini

sed-i's/;date.timezone =.*/date.timezone = PRC/g' /usr/local/php/etc/php.ini

sed-i's/short_open_tag =.*/short_open_tag = On/g' /usr/local/php/etc/php.ini

sed-i's/;cgi.fix_pathinfo=.*/cgi.fix_pathinfo=0/g' /usr/local/php/etc/php.ini

sed-i's/max_execution_time =.*/max_execution_time = 300/g' /usr/local/php/etc/php.ini

sed-i's/disable_functions =.*/disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g' /usr/local/php/etc/php.ini

pear config-setphp_ini/usr/local/php/etc/php.ini

pecl config-setphp_ini/usr/local/php/etc/php.ini

curl-sS--connect-timeout30 -m60https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

#写入配置文件cat>/usr/local/php/etc/php-fpm.conf<

error_log= /usr/local/php/var/log/php-fpm.log

log_level=notice[www]listen= /tmp/php-cgi.sock

listen.backlog= -1listen.allowed_clients= 127.0.0.1listen.owner=www

listen.group =www

listen.mode= 0666user=wwwgroup =www

pm= dynamicpm.max_children= 10pm.start_servers= 2pm.min_spare_servers= 1pm.max_spare_servers= 6pm.max_requests= 1024pm.process_idle_timeout= 10srequest_terminate_timeout= 100request_slowlog_timeout= 0slowlog= var/log/slow.log

EOF

cp sapi/fpm/init.d.php-fpm.in /etc/init.d/php73-fpm

cp sapi/fpm/php-fpm.service.in /usr/lib/systemd/system/php-fpm73.service

chmod+x/etc/init.d/php73-fpm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值