日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

amh 4.2 升级php_Centos系统 + AMH4.2面板 PHP升级7.3.5

發布時間:2024/9/19 php 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 amh 4.2 升级php_Centos系统 + AMH4.2面板 PHP升级7.3.5 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先說一下 基本環境信息,我用的是linux系統 + AMH4.2面板 已經安裝好PHP5.6、PHP7.0、PHP7.1,希望將PHP7.3.5安裝在PHP7.0目錄中/usr/local/php7.0以方便面板虛擬機對php按本的選擇。

一. 下載和解壓PHP7.3.5

下載wget http://cn2.php.net/distributions/php-7.3.5.tar.gz

或wget https://www.php.net/distributions/php-7.3.5.tar.xz

解壓tar -zxvf php-7.3.5.tar.gz

進入php-7.3.5文件夾中cd php-7.3.5

二. 編譯PHP7.3.5./configure --prefix=/usr/local/php7.0 --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --with-zlib --with-curl --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-zip --enable-openssl --enable-pcntl --with-iconv=/usr/local/libiconv --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --without-pear

編譯完成之后,執行安裝命令make && make install

安裝過程大約需要10分鐘時間,請耐心等待。

三、配置PHP

上面編譯過程中我們已經將配置文件指明了位置路徑--prefix=/usr/local/php7.0 指明了安裝php路徑,

-with-config-file-path=/etc 指明了php.ini存放路徑。

[可選項] 設置讓PHP錯誤信息打印在頁面上vim /usr/local/php/php.ini

display_errors = On

修改/usr/local/php7.0/etc/php-fpm.conf.default

添加腳本授權listen.owner = www

listen.group = www

listen.mode = 0660

重啟linux,如果openssl報錯,說明openssl文件沒有安裝或者php.ini配置有問題。為了進一步確認問題所在可以在測試環境中查看phpinfo()看看到底是哪里出現的問題。我這里查看出現的是配置有問題,如圖:

可以看出來openssl目錄與路徑都為空

解決辦法:

/etc/php.ini

追加extension=openssl

openssl.capath=/etc/pki/tls/certs/

openssl.cafile=/etc/pki/tls/certs/ca-bundle.crt

重新啟動環境,查看配置如下

目錄與ca證書已經加載成功。

因為在上面我們在安裝php編譯過程中已經將openssl配置編譯進去了,所以這里只需要配置一下就好。注意:如果是在前面編譯文件的時候沒有將openssl擴展編譯進去下面我們將安裝php7.3.5 openssl擴展方法寫出來。

五、安裝openssl

1、找到之前編譯安裝PHP的安裝包。

2、解壓并進入文件夾cd php7.3.5/ext/openssl

3、運行 phpize 初始化php,因為我們將php7.3.5安裝在/usr/local/php7.0目錄中了,所以php初始化文件在php7.0目錄中。/usr/local/php7.0/bin/phpize備注,如果出現如下錯誤:Cannot find config.m4.

Make sure that you run ‘/usr/local/php/bin/phpize’ in the top level source directory of the module

【解決辦法】cp ./config0.m4 ./config.m4 即可解決,解決問題后需要重新初始化,因為前面初始化過程中并沒有成功。

4、編譯./configure --with-openssl --with-php-config=/usr/local/php7.0/bin/php-config

5、安裝make && make install

安裝成功會打印出如下信息:/bin/sh /root/php-7.3.5/ext/openssl/libtool --mode=install cp ./openssl.la /root/php-7.3.5/ext/openssl/modules

cp ./.libs/openssl.so /root/php-7.3.5/ext/openssl/modules/openssl.so

cp ./.libs/openssl.lai /root/php-7.3.5/ext/openssl/modules/openssl.la

PATH="$PATH:/sbin" ldconfig -n /root/php-7.3.5/ext/openssl/modules

----------------------------------------------------------------------

Libraries have been installed in:

/root/php-7.3.5/ext/openssl/modules

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR'

flag during linking and do at least one of the following:

- add LIBDIR to the `LD_LIBRARY_PATH' environment variable

during execution

- add LIBDIR to the `LD_RUN_PATH' environment variable

during linking

- use the `-Wl,--rpath -Wl,LIBDIR' linker flag

- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------

Build complete.

Don't forget to run 'make test'.

Installing shared extensions: /usr/local/php7.0/lib/php/extensions/no-debug-non-zts-20180731/

最后提示的目錄就是openssl.so安裝成功的目錄,進入后會發現是如下信息。

/usr/local/php7.0/lib/php/extensions/no-debug-non-zts-20180731/openssl.so

5、找到php.ini,在最后面添加如下內容

extension=openssl.so

重啟nginx,查看phpinfo(),到這里我們從php安裝到openssl擴展的安裝也就說完了。

總結

以上是生活随笔為你收集整理的amh 4.2 升级php_Centos系统 + AMH4.2面板 PHP升级7.3.5的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。