configure: error: not found.错误的解决方法

时间:2025-03-17 12:21:20

今天安装PHP的时候提示这个错误 configure: error: not found.,这个是选择安装GD模块才会出现的错误,详细错误信息如下:

If configure fails try --with-vpx-dir=<DIR>
If configure fails try --with-jpeg-dir=<DIR>
configure: error: not found.


经查资料说是libpng,devel包没安装,

执行下面两条命令即可解决

yum install libpng

yum install libpng-devel

然后重新编译安装就行了   


安装php扩展步骤

1.找到源码目录   ext;

2.源码目录 scripts/phpize, 生成conffigure文件  /home/huoweijie/package/php-7.1.0/scripts/phpize

这个时候会报没有权限的错误  Permission denied  别着急  这是没有可执行的权限 修改一下权限就好了  chmod +x /home/huoweijie/package/php-7.1.0/scripts/phpize

3.用./configure --with-php-config=/usr/local/php/bin/php-config

&& make install

5.修改     vim /usr/local/php/etc/ in

6.重启php-fpm就ok了  可以用killall php-fpm  杀死php-fpm进程  然后重启 /usr/local/php/bin/php-fpm

第二步的时候有的同志可能会出现这个报错:

Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
Cannot find autoconf. Please check your autoconf installation and the  $PHP_AUTOCONF  environment variable is set correctly and then rerun this script.

出现这个报错的时候不要着急  请查看博主的 《phpize 编译安装php扩展的时候出现Cannot find autoconf的解决方法》  这篇文章

链接为:/lovely_1014