ecs 安裝PHP 7.2
版本查看
php-v
一直顯示5.4
版本異常解決辦法
yum remove php
在刪除已安裝的依賴
# 查看
rpm -qa|grep php
#刪除
rpm -e 上面的依賴
安裝php7.2
下載
https://www.php.net/downloads.php
編譯 執行
./configure --prefix=/usr/local/php --with-curl=/usr/local/curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip --disable-fileinfo
注意: 報錯
virtual memory exhausted: Cannot allocate memory make: *** [ext/fileinfo/libmagic/apprentice.lo] Error
在配置末尾添加 --disable-fileinfo
重新make && make install
# 再次查看版本
php -v
PHP 7.2.30 (cli) (built: May 4 2020 16:03:54) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies
## 配置
略