我正在尝试在 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
如何解决此错误?
我正在尝试在 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
如何解决此错误?
该phpize
命令旨在在扩展源目录的顶层运行(此源目录应包含文件名 config.m4)。
用简单的英语来说,这意味着您从错误的目录运行命令。您需要位于包含您尝试安装的扩展程序的源代码的目录中。
例如,如果您尝试安装 mcrypt,就像我遇到此堆栈溢出页面时一样,您需要在 php-5.6.24/ext/mcrypt 中然后运行命令。
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
进入 xdebug 文件夹而不是尝试运行 phpize
有时,使用 pecl 安装程序不是一种选择。这可能是因为您位于防火墙后面,也可能是因为您要安装的扩展不能作为 PECL 兼容包提供,例如来自 git 的未发布扩展。如果您需要构建这样的扩展,您可以使用较低级别的构建工具手动执行构建。
phpize 命令用于为 PHP 扩展准备构建环境。在以下示例中,扩展的源位于名为 extname 的目录中:
$ cd extname
$ phpize
$ ./configure
$ make
# make install
第一次运行./configure
它会创建config.m4
文件,其余步骤相同