phpize报告“找不到config.m4”

时间:2013-07-24 12:42:04

标签: php macos osx-mountain-lion

我正在尝试在MacOSx Mountain Lion上运行'phpize'命令,但这就是我得到的:

 Cannot find config.m4. 
 Make sure that you run '/opt/local/bin/phpize' in the top level source directory of the module

如何解决此错误?

6 个答案:

答案 0 :(得分:23)

phpize命令应在扩展源目录的顶层运行(此源目录应包含文件名config.m4)。

有关详细信息,请参阅http://php.net/manual/en/install.pecl.phpize.php

答案 1 :(得分:5)

简单来说,这意味着你从错误的目录运行命令。您需要位于包含您尝试安装的扩展的源的目录中。

例如,如果您尝试安装mcrypt,就像我遇到此堆栈溢出页面时一样,您需要在php-5.6.24 / ext / mcrypt中运行命令。

答案 2 :(得分:2)

http://qiita.com/MasatoYoshioka@github/items/e542f39a6f1a3bc1f71e

在终端

ls config.m4

ls config*

config.w32  config0.m4

cp config0.m4 config.m4

cd /usr/local/src/php-5.3.29/ext/zlib
phpize
./configure
make clean && make && make install

nano php.ini
 add extension=zlib.so

答案 3 :(得分:2)

我的问题是我试图执行该命令只是为了查看是否已安装该命令。

尝试单独执行命令会给您带来该错误,请仅在包含您要安装的扩展程序的目录(很可能是您下载的目录)中使用它。

这里有一些说明,例如,为php7.2安装Xdebug。

在第3步和第4步中要特别小心,首先将dir更改为解压缩的下载扩展名,然后运行phpize

Xdebug install instructions

答案 4 :(得分:1)

在xdebug文件夹内,而不是尝试运行phpize

答案 5 :(得分:-1)

首先运行./configure它将创建config.m4文件,其余步骤相同

相关问题