#下载地址: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