欢迎光临
我们一直在努力

[Centos]编译安装PHP7.3

1、安装编译CMake

因为php7.3需要安装libzip11+的版本,但是编译libzip新版需要最新的cmake,所以系统自带的cmake版本不够,所以需要重新安装

<span class="com">#下载地址:https://cmake.org/download/</span>
<span class="com">#工具包 git@gitee.com:bbhsky/PHP-Setup.git</span><span class="pln">
yum </span><span class="pun">-</span><span class="pln">y remove cmake
tar zxvf cmake</span><span class="pun">-</span><span class="lit">3.15</span><span class="pun">.</span><span class="lit">2.tar</span><span class="pun">.</span><span class="pln">gz
cd cmake</span><span class="pun">-</span><span class="lit">3.15</span><span class="pun">.</span><span class="lit">2</span>
<span class="pun">./</span><span class="pln">configure </span><span class="pun">--</span><span class="pln">prefix</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">cmake</span><span class="pun">-</span><span class="lit">3.15</span><span class="pun">.</span><span class="lit">2</span><span class="pln">
make </span><span class="pun">-</span><span class="pln">j </span><span class="str">`grep 'processor' /proc/cpuinfo | wc -l`</span> <span class="pun">&&</span><span class="pln"> make install
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">cmake</span><span class="pun">-</span><span class="lit">3.15</span><span class="pun">.</span><span class="lit">2</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">cmake
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">cmake</span><span class="pun">/</span><span class="pln">bin</span><span class="com">/* /usr/bin/
rm -rf cmake-3.15.2</span>

2、编译安装libzip

<span class="com">#下载地址:https://libzip.org/download/</span>
<span class="com">#工具包 git@gitee.com:bbhsky/PHP-Setup.git</span><span class="pln">
yum </span><span class="pun">-</span><span class="pln">y remove libzip</span><span class="pun">-</span><span class="pln">devel libzip
tar zxvf libzip</span><span class="pun">-</span><span class="lit">1.5</span><span class="pun">.</span><span class="lit">2.tar</span><span class="pun">.</span><span class="pln">gz
cd libzip</span><span class="pun">-</span><span class="lit">1.5</span><span class="pun">.</span><span class="lit">2</span><span class="pln">
mkdir build </span><span class="pun">&&</span><span class="pln"> cd build</span><span class="pun">/</span><span class="pln">
cmake </span><span class="pun">..</span><span class="pln">
make </span><span class="pun">-</span><span class="pln">j </span><span class="str">`grep 'processor' /proc/cpuinfo | wc -l`</span> <span class="pun">&&</span><span class="pln"> make install
</span><span class="com"># 添加搜索路径到配置文件</span><span class="pln">
echo </span><span class="str">'/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'</span><span class="pun">>></span><span class="str">/etc/</span><span class="pln">ld</span><span class="pun">.</span><span class="pln">so</span><span class="pun">.</span><span class="pln">conf
</span><span class="com"># 更新配置</span><span class="pln">
ldconfig </span><span class="pun">-</span><span class="pln">v
rm </span><span class="pun">-</span><span class="pln">rf libzip</span><span class="pun">-</span><span class="lit">1.5</span><span class="pun">.</span><span class="lit">2</span>

3、编译安装php

<span class="com">#下载地址:http://php.net/</span>
<span class="com">#工具包 git@gitee.com:bbhsky/PHP-Setup.git</span><span class="pln">
tar jxvf php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">.</span><span class="lit">8.tar</span><span class="pun">.</span><span class="pln">bz2
cd php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">.</span><span class="lit">8</span><span class="pun">/</span>
<span class="pun">./</span><span class="pln">configure </span><span class="pun">--</span><span class="pln">prefix</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">.</span><span class="lit">8</span> <span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">config</span><span class="pun">-</span><span class="pln">file</span><span class="pun">-</span><span class="pln">path</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">.</span><span class="lit">8</span><span class="pun">/</span><span class="pln">etc </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">config</span><span class="pun">-</span><span class="pln">file</span><span class="pun">-</span><span class="pln">scan</span><span class="pun">-</span><span class="pln">dir</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">.</span><span class="lit">8</span><span class="pun">/</span><span class="pln">conf</span><span class="pun">.</span><span class="pln">d </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">fpm </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">-</span><span class="pln">user</span><span class="pun">=</span><span class="pln">www </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">-</span><span class="kwd">group</span><span class="pun">=</span><span class="pln">www </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">mysqlnd </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">mysqli</span><span class="pun">=</span><span class="pln">mysqlnd </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">pdo</span><span class="pun">-</span><span class="pln">mysql</span><span class="pun">=</span><span class="pln">mysqlnd </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">iconv</span><span class="pun">-</span><span class="pln">dir</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">libiconv </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">freetype</span><span class="pun">-</span><span class="pln">dir</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">freetype </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">jpeg</span><span class="pun">-</span><span class="pln">dir </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">png</span><span class="pun">-</span><span class="pln">dir </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">zlib </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">libxml</span><span class="pun">-</span><span class="pln">dir</span><span class="pun">=</span><span class="str">/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl=/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">curl </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">mbregex </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">mbstring </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">intl </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">pcntl </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">ftp </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">gd </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">openssl</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">openssl </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">mhash </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">pcntl </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">sockets </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">xmlrpc </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">zip </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">soap </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">gettext </span><span class="pun">--</span><span class="pln">disable</span><span class="pun">-</span><span class="pln">fileinfo </span><span class="pun">--</span><span class="pln">enable</span><span class="pun">-</span><span class="pln">opcache </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">xsl </span><span class="pun">--</span><span class="kwd">with</span><span class="pun">-</span><span class="pln">libzip

make ZEND_EXTRA_LIBS</span><span class="pun">=</span><span class="str">'-liconv'</span> <span class="pun">-</span><span class="pln">j </span><span class="str">`grep 'processor' /proc/cpuinfo | wc -l`</span><span class="pln">
make install
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">.</span><span class="lit">8</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pln">
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7</span><span class="pln">
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">php </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">php
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">phpize </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">phpize
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">pear </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">pear
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">pecl </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">pecl
ln </span><span class="pun">-</span><span class="pln">sf </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">sbin</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm
mkdir </span><span class="pun">-</span><span class="pln">p </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">conf</span><span class="pun">.</span><span class="pln">d
mkdir </span><span class="pun">-</span><span class="pln">p </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc
cp php</span><span class="pun">.</span><span class="pln">ini</span><span class="pun">-</span><span class="pln">production </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/post_max_size =.*/post_max_size = 50M/g'</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/upload_max_filesize =.*/upload_max_filesize = 50M/g'</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/;date.timezone =.*/date.timezone = PRC/g'</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/short_open_tag =.*/short_open_tag = On/g'</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/;cgi.fix_pathinfo=.*/cgi.fix_pathinfo=0/g'</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/max_execution_time =.*/max_execution_time = 300/g'</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'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'</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
pear config</span><span class="pun">-</span><span class="kwd">set</span><span class="pln"> php_ini </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
pecl config</span><span class="pun">-</span><span class="kwd">set</span><span class="pln"> php_ini </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">.</span><span class="pln">ini
curl </span><span class="pun">-</span><span class="pln">sS </span><span class="pun">--</span><span class="pln">connect</span><span class="pun">-</span><span class="pln">timeout </span><span class="lit">30</span> <span class="pun">-</span><span class="pln">m </span><span class="lit">60</span><span class="pln"> https</span><span class="pun">:</span><span class="com">//getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer</span>
<span class="com">#写入配置文件</span><span class="pln">
cat </span><span class="pun">></span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="pln">conf</span><span class="pun"><<</span><span class="pln">EOF
</span><span class="pun">[</span><span class="kwd">global</span><span class="pun">]</span><span class="pln">
pid </span><span class="pun">=</span> <span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">run</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="pln">pid
error_log </span><span class="pun">=</span> <span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">log</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="pln">log
log_level </span><span class="pun">=</span><span class="pln"> notice
</span><span class="pun">[</span><span class="pln">www</span><span class="pun">]</span><span class="pln">
listen </span><span class="pun">=</span> <span class="str">/tmp/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">cgi</span><span class="pun">.</span><span class="pln">sock
listen</span><span class="pun">.</span><span class="pln">backlog </span><span class="pun">=</span> <span class="pun">-</span><span class="lit">1</span><span class="pln">
listen</span><span class="pun">.</span><span class="pln">allowed_clients </span><span class="pun">=</span> <span class="lit">127.0</span><span class="pun">.</span><span class="lit">0.1</span><span class="pln">
listen</span><span class="pun">.</span><span class="pln">owner </span><span class="pun">=</span><span class="pln"> www
listen</span><span class="pun">.</span><span class="kwd">group</span> <span class="pun">=</span><span class="pln"> www
listen</span><span class="pun">.</span><span class="pln">mode </span><span class="pun">=</span> <span class="lit">0666</span><span class="pln">
user </span><span class="pun">=</span><span class="pln"> www
</span><span class="kwd">group</span> <span class="pun">=</span><span class="pln"> www
pm </span><span class="pun">=</span> <span class="kwd">dynamic</span><span class="pln">
pm</span><span class="pun">.</span><span class="pln">max_children </span><span class="pun">=</span> <span class="lit">10</span><span class="pln">
pm</span><span class="pun">.</span><span class="pln">start_servers </span><span class="pun">=</span> <span class="lit">2</span><span class="pln">
pm</span><span class="pun">.</span><span class="pln">min_spare_servers </span><span class="pun">=</span> <span class="lit">1</span><span class="pln">
pm</span><span class="pun">.</span><span class="pln">max_spare_servers </span><span class="pun">=</span> <span class="lit">6</span><span class="pln">
pm</span><span class="pun">.</span><span class="pln">max_requests </span><span class="pun">=</span> <span class="lit">1024</span><span class="pln">
pm</span><span class="pun">.</span><span class="pln">process_idle_timeout </span><span class="pun">=</span> <span class="lit">10s</span><span class="pln">
request_terminate_timeout </span><span class="pun">=</span> <span class="lit">100</span><span class="pln">
request_slowlog_timeout </span><span class="pun">=</span> <span class="lit">0</span><span class="pln">
slowlog </span><span class="pun">=</span> <span class="kwd">var</span><span class="pun">/</span><span class="pln">log</span><span class="pun">/</span><span class="pln">slow</span><span class="pun">.</span><span class="pln">log
EOF
cp sapi</span><span class="pun">/</span><span class="pln">fpm</span><span class="pun">/</span><span class="pln">init</span><span class="pun">.</span><span class="pln">d</span><span class="pun">.</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="kwd">in</span> <span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">init</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">php73</span><span class="pun">-</span><span class="pln">fpm
cp sapi</span><span class="pun">/</span><span class="pln">fpm</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="pln">service</span><span class="pun">.</span><span class="kwd">in</span> <span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">systemd</span><span class="pun">/</span><span class="pln">system</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm73</span><span class="pun">.</span><span class="pln">service
chmod </span><span class="pun">+</span><span class="pln">x </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">init</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">php73</span><span class="pun">-</span><span class="pln">fpm</span>

以上按照正常是安装完成了,这里还有个配置需要修改

<span class="pln">vim </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">systemd</span><span class="pun">/</span><span class="pln">system</span><span class="pun">/</span><span class="pln">php73</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="pln">service
</span><span class="com">#注意这里的物理路径</span>
<span class="pun">[</span><span class="typ">Unit</span><span class="pun">]</span>
<span class="typ">Description</span><span class="pun">=</span><span class="typ">The</span><span class="pln"> PHP </span><span class="typ">FastCGI</span> <span class="typ">Process</span> <span class="typ">Manager</span>
<span class="typ">After</span><span class="pun">=</span><span class="pln">network</span><span class="pun">.</span><span class="pln">target

</span><span class="pun">[</span><span class="typ">Service</span><span class="pun">]</span>
<span class="typ">Type</span><span class="pun">=</span><span class="pln">simple
</span><span class="typ">PIDFile</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">run</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="pln">pid
</span><span class="typ">ExecStart</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">/</span><span class="pln">sbin</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm </span><span class="pun">--</span><span class="pln">nodaemonize </span><span class="pun">--</span><span class="pln">fpm</span><span class="pun">-</span><span class="pln">config </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="lit">7.3</span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">php</span><span class="pun">-</span><span class="pln">fpm</span><span class="pun">.</span><span class="pln">conf
</span><span class="typ">ExecReload</span><span class="pun">=</span><span class="str">/bin/</span><span class="pln">kill </span><span class="pun">-</span><span class="pln">USR2 $MAINPID
</span><span class="typ">PrivateTmp</span><span class="pun">=</span><span class="kwd">true</span>

<span class="pun">[</span><span class="typ">Install</span><span class="pun">]</span>
<span class="typ">WantedBy</span><span class="pun">=</span><span class="pln">multi</span><span class="pun">-</span><span class="pln">user</span><span class="pun">.</span><span class="pln">target</span>
赞(0)
未经允许不得转载:798VPS » [Centos]编译安装PHP7.3
分享到: 更多 (0)