溫馨提示×

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

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

如何安裝linux多個(gè)php版本

發(fā)布時(shí)間:2020-08-10 09:56:40 來(lái)源:億速云 閱讀:240 作者:Leah 欄目:編程語(yǔ)言

這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)如何安裝linux多個(gè)php版本,文章內(nèi)容豐富且以專(zhuān)業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

linux安裝多個(gè)php版本的方法:首先下載不同的php源碼包;然后將其解壓后并安裝在不同的目錄下;最后修改“php-fpm”監(jiān)聽(tīng)的端口號(hào)即可。

思路:

  下載不同的php源碼包,解壓后安裝在不同的目錄下,修改php-fpm監(jiān)聽(tīng)的端口號(hào)

php安裝配置參數(shù):

./configure --prefix=/usr/local/php71 --exec-prefix=/usr/local/php71 --bindir=/usr/local/php71/bin --sbindir=/usr/local/php71/sbin --includedir=/usr/local/php71/include --libdir=/usr/local/php71/lib/php --mandir=/usr/local/php71/php/man --with-config-file-path=/usr/local/php71/etc --with-mcrypt=/usr/local/libmcrypt --with-mhash --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-gd --with-iconv --with-zlib --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-fpm --without-gdbm --disable-fileinfo --enable-opcache=no
make && make install

運(yùn)行 /usr/local/php71/sbin/php-fpm 報(bào)錯(cuò)如下:

原因:php-fpm.conf 文件不存在

解決:

修改www.conf文件,修改php-fpm監(jiān)聽(tīng)的端口號(hào) 改為9001

啟動(dòng)php-fpm,結(jié)果如下,成功了,系統(tǒng)運(yùn)行了兩個(gè)版本的php

最后,可以將新版本的php加入開(kāi)機(jī)自啟動(dòng),修改 /etc/rc.local文件,加入php-fpm的運(yùn)行路徑即可

上述就是小編為大家分享的如何安裝linux多個(gè)php版本了,如果剛好有類(lèi)似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。

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

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

AI