這篇文章主要介紹“php如何安裝fpm擴(kuò)展”的相關(guān)知識,小編通過實(shí)際案例向大家展示操作過程,操作方法簡單快捷,實(shí)用性強(qiáng),希望這篇“php如何安裝fpm擴(kuò)展”文章能幫助大家解決問題。
網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、微信小程序、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了永新免費(fèi)建站歡迎大家使用!
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)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點(diǎn)。