首頁論壇分類作業系統LinuxCentOS 7.x 編譯安裝 PHP
CentOS 7.x 編譯安裝 PHP
   編 輯        刪 除      # 5c8224a78db84 發表: Odyssey     新增:2018-09-19 11:53:07     更新:2020-01-20 11:43:12

PHP: Hypertext Preprocessor

http://php.net/


PHP: Downloads

http://php.net/downloads.php


下載 PHP

cd /usr/local/src
lynx https://www.php.net/distributions/php-7.3.11.tar.bz2

安裝 php-7.3.11

tar jxf php-7.3.11.tar.bz2
cd php-7.3.11

# 自訂版(請自行依當時情況更動)

./configure --prefix=/usr/local/php7 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-maintainer-zts --with-tsrm-pthreads --enable-bcmath --without-bz2 --enable-calendar --enable-cgi --enable-cli --enable-ctype --with-curl=/usr/local/curl --enable-dom --without-enchant --enable-exif --enable-fileinfo --enable-filter --enable-ftp --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --without-gd --with-gettext --with-gmp=/usr/local/gmp --enable-hash --with-iconv --without-imap --disable-intl --enable-json --enable-libxml --enable-mbstring --with-mhash --enable-mysqlnd --with-mysqli=mysqlnd --with-mysql-sock --enable-opcache --with-openssl --enable-pcntl --without-pear --with-pdo-mysql=mysqlnd --with-pdo-pgsql --with-pgsql=/usr/local/pgsql --enable-phar --enable-posix --enable-session --enable-shmop --enable-simplexml --enable-soap --enable-sockets --with-sodium=/usr/local/libsodium --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-tokenizer --enable-wddx --enable-xml --enable-xmlreader --with-xmlrpc --with-xsl --with-libzip --with-zlib
make
make test
make install
make clean

複製 PHP 設定檔

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

複製 php-fpm 設定檔

cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf

編輯設定檔

vi /usr/local/php7/etc/php.ini
vi /usr/local/php7/etc/php-fpm.conf
vi /usr/local/php7/etc/php-fpm.d/www.conf

啟動 php-fpm

/usr/local/php7/sbin/php-fpm  -c /usr/local/php7/etc/php.ini -y /usr/local/php7/etc/php-fpm.conf

顯示系統執行程序

ps -A

刪除 php-fpm 程序

killall -KILL php-fpm

夢幻奧德修斯 - OdysseusDream

Website:https://www.odysseusdream.com/

Discord:https://discord.gg/ht4mwMG

FB社團:https://www.facebook.com/groups/OdysseusDream/

FB粉專:https://www.facebook.com/OdysseusDream/

我要回覆
CentOS 7.x 編譯安裝 PHP
首頁論壇分類作業系統LinuxCentOS 7.x 編譯安裝 PHP