centos 下 php7.4 安装

安装过程参考 https://www.cnblogs.com/liubaoqing/p/12176017.html

 

新的配置选项,有些是默认包含,有些已经更改表述方式

记录PHP7.4安装gd库的报错error: --with-freetype-dir --with-jpeg-dir

https://blog.csdn.net/weixin_43272072/article/details/107390871  

从 PHP 7.3.x 移植到 PHP 7.4.x(例如 gd 的相关改变)

https://www.php.net/manual/zh/migration74.other-changes.php

 

核心配置选项说明

https://www.php.net/manual/zh/configure.about.php

扩展选项需要逐个查看文档查找是否需要配置,怎么配置

 

./configure

--prefix=/abc/server/php7422
--with-config-file-path=/abc/server/php7422/etc
--with-config-file-scan-dir=/abc/server/php7422/etc/php.d
--enable-fpm
--with-fpm-user=www
--with-fpm-group=www
--enable-sockets
--enable-soap
--with-xmlrpc
--enable-opcache
--enable-pcntl
--enable-bcmath
--enable-mbstring
--with-gettext
--enable-mysqlnd
--with-mysqli
--with-pdo-mysql
--enable-gd
--with-freetype
--with-jpeg
--with-webp=/usr/include/webp
--with-curl
--with-openssl=/usr/local/ssl
--with-mhash
--with-zlib
--with-zip
--with-bz2
--with-pear
--with-xsl

 

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

 

posted @ 2021-07-08 16:17  忘忧般若汤  阅读(545)  评论(0编辑  收藏  举报