centos 下 php7.4 安裝

參考版本 

https://www.cnblogs.com/liubaoqing/p/12176017.html

 下載

wget https://www.php.net/distributions/php-7.4.21.tar.gz
tar -zxvf php-7.4.0.tar.gz

 安裝配置

./configure  
--prefix=/abc/server/php74
--with-config-file-path=/abc/server/php74/etc
--with-config-file-scan-dir=/abc/server/php74/etc/php.d
--with-fpm-user=www
--with-fpm-group=www
--enable-fpm
--enable-sockets
--enable-soap
--enable-session
--enable-opcache
--enable-mysqlnd
--enable-mbstring
--enable-gd
--with-curl
--with-openssl
--with-openssl-dir=/usr/local/ssl
--with-mhash
--with-mysqli
--with-pdo-mysql
--with-pdo-sqlite
--with-iconv
--with-iconv-dir
--with-zlib
--with-gettext
--with-kerberos
--with-libdir=lib64
--with-pear
--with-xmlrpc
--with-xsl
--with-zip
--with-bz2
--enable-bcmath
--enable-pcntl

 

CentOS 7編譯安裝PHP 7.4提示No package 'libzip' found或者(libzip >= 0.11)

https://www.jianshu.com/p/d01665bfa4eb   https://www.jeeinn.com/2020/06/1319/  另一種解決方法,沒嘗試

注意安裝版本,當前 1.8 需要 更多依賴。此處選擇低版本

wget https://libzip.org/download/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

安裝後,可能還是無法找到

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

 

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'pdo_mysql' in Unknown on line 0

 https://blog.csdn.net/tornge/article/details/51388233 

php7 ,pdo都是默認安裝的

資料原來是php.ini中關於mysql的socket路徑的問題

根據 /etc/my.cnf

datadir = /data/vdb1/mysql

修改 php.ini

pdo_mysql.default_socket=/data/vdb1/mysql/mysql.sock

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章