溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

php如何安裝fpm擴(kuò)展

發(fā)布時(shí)間:2023-02-02 10:18:41 來源:億速云 閱讀:146 作者:iii 欄目:編程語言

這篇文章主要介紹“php如何安裝fpm擴(kuò)展”的相關(guān)知識,小編通過實(shí)際案例向大家展示操作過程,操作方法簡單快捷,實(shí)用性強(qiáng),希望這篇“php如何安裝fpm擴(kuò)展”文章能幫助大家解決問題。

php安裝fpm擴(kuò)展的方法:1、通過“wget”命令安裝php包;2、設(shè)置安裝參數(shù);3、使用“yum install”命令安裝php依賴包;4、通過“/usr/local/php-fpm/bin/php --ini vi /usr/local/php-fpm/etc/php.ini”查找php并加載php.ini路徑即可。

php 安裝php-fpm/多版本PHP添加拓展

與lamp安裝PHP有區(qū)別, LNMP需要開啟PHP-fpm服務(wù)

cd /usr/local/src/
wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
tar zxf php-5.6.30.tar.gz
useradd -s /sbin/nologin php-fpm
cd php-5.6.30

./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl  --with-openssl

php 安裝參數(shù)

 ./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl  --with-openssl
./configure --prefix=/usr/local/php-fpm  //安裝位置
--with-config-file-path=/usr/local/php-fpm/etc //配置文件路徑
--with-fpm-user=php-fpm     //user
--with-fpm-group=php-fpm  //group
--with-mysql=/usr/local/mysql  //支持MySQL
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-pdo-mysql=/usr/local/mysql
--with-mysql-sock=/tmp/mysql.sock
#安裝php依賴包
yum install libmcrypt-devel
yum install freetype-devel
yum -y install libpng-devel
yum -y install libjpeg-devel
yum install libcurl-devel

find / -name "xml2-config"  #查看此文件是否存在
yum install libxml2-devel -y

make && make install
cp php.ini-production /usr/local/php-fpm/etc/php.ini
vi /usr/local/php/etc/php-fpm.conf //寫入如下內(nèi)容(參考https://coding.net/u/aminglinux/p/aminglinux-book/git/blob/master/D15Z/php-fpm.conf)
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm  // php-fpm 添加到可service啟動(dòng)
chmod 755 /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
service php-fpm start
ps aux |grep php-fpm

wget http://pecl.php.net/get/stomp-1.0.9.tgz
tar xf stomp-1.0.9.tgz
cd stomp-1.0.9
/usr/local/php-fpm/bin/phpize
./configure --with-php-config=/usr/local/php-fpm/bin/php-config
make && make install


# 查找php加載php.ini路徑
/usr/local/php-fpm/bin/php --ini
vi /usr/local/php-fpm/etc/php.ini
# 末尾添加
extension_dir = "/usr/local/php-fpm/lib/php/extensions/no-debug-non-zts-20131226/"
extension=stomp.so

# 應(yīng)用PHP相關(guān)路徑要明確指定,避免與系統(tǒng)自帶PHP想混淆

關(guān)于“php如何安裝fpm擴(kuò)展”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識,可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會(huì)為大家更新不同的知識點(diǎn)。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI