一,查看编译时的参数:
[lhdop@blog etc]$ /usr/local/soft/php7/bin/php -i | grep configure Configure Command => './configure' '--prefix=/usr/local/soft/php7' '--with-curl' '--with-freetype' '--enable-gd' '--with-jpeg'
'--with-gettext' '--with-iconv-dir=/usr/local' '--with-kerberos' '--with-libdir=lib64' '--with-libxml' '--with-mysqli' '--with-openssl'
'--with-pdo-mysql' '--with-pdo-sqlite' '--with-pear' '--with-mhash' '--with-ldap-sasl' '--with-xmlrpc' '--with-xsl' '--with-zlib'
'--enable-fpm' '--enable-bcmath' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop'
'--enable-soap' '--enable-sockets' '--enable-xml' '--with-zip' '--with-config-file-path=/usr/local/soft/php7/etc' '-with-bz2'
'--enable-inline-optimization' '--enable-sysvsem'
include/php/main/build-defs.h: #define CONFIGURE_COMMAND " './configure' '--prefix=/usr/local/soft/php7' '--with-curl' '--with-freetype' '--enable-gd'
'--with-jpeg' '--with-gettext' '--with-iconv-dir=/usr/local' '--with-kerberos' '--with-libdir=lib64' '--with-libxml' '--with-mysqli'
'--with-openssl' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-pear' '--with-mhash' '--with-ldap-sasl' '--with-xmlrpc' '--with-xsl'
'--with-zlib' '--enable-fpm' '--enable-bcmath' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-xml' '--with-zip'
'--with-config-file-path=/usr/local/soft/php7/etc' '-with-bz2' '--enable-inline-optimization' '--enable-sysvsem'"
说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
或: https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,增加编译参数
[root@blog ~]# cd /usr/local/source/ [root@blog source]# cd php-7.4.2/
clean
[root@blog php-7.4.2]# make clean
重新configure
[root@blog php-7.4.2]# ./configure --prefix=/usr/local/soft/php7 --with-curl --with-freetype --enable-gd --with-jpeg
--with-gettext --with-iconv-dir=/usr/local --with-kerberos --with-libdir=lib64 --with-libxml --with-mysqli --with-openssl
--with-pdo-mysql --with-pdo-sqlite --with-pear --with-mhash --with-ldap-sasl --with-xmlrpc --with-xsl --with-zlib
--enable-fpm --enable-bcmath --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap
--enable-sockets --enable-xml --with-zip --with-config-file-path=/usr/local/soft/php7/etc -with-bz2 --enable-inline-optimization
--enable-sysvsem --enable-exif
[root@blog php-7.4.2]# make && make install
[root@blog php-7.4.2]# /usr/local/soft/php7/daemon/php-fpm restart Gracefully shutting down php-fpm . done Starting php-fpm done
Fatal error: Uncaught Error: Call to undefined function exif_read_data() in /web/think_web/think_www/prog_action/test/test_action.php:11
Stack trace:
#0 /web/think_web/think_www/html/v.php(165): test_action->go()
#1 {main} thrown in /web/think_web/think_www/prog_action/test/test_action.php on line 11
三,查看php的版本:
[lhdop@blog php7]$ /usr/local/soft/php7/bin/php --version PHP 7.4.2 (cli) (built: Mar 5 2020 11:16:38) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies