php phpize 报告“找不到 config.m4”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17834363/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:32:31  来源:igfitidea点击:

phpize reports "Cannot find config.m4"

phpmacososx-mountain-lion

提问by Ankit Rustagi

I am trying to run the 'phpize' command on MacOSx Mountain Lion, but this is what I get:

我正在尝试在 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

How do I resolve this error ?

如何解决此错误?

采纳答案by nstCactus

The phpizecommand is meant to be run at the top level of an extension source dir (this source dir should contain a file name config.m4).

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

See http://php.net/manual/en/install.pecl.phpize.phpfor more information.

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

回答by Erin Geyer

In plain English, it means you're running the command from the wrong directory. You need to be in the directory that contains the source for the extension you're trying to install.

通俗地说,这意味着您从错误的目录中运行命令。您需要位于包含您尝试安装的扩展程序源的目录中。

For example, if you're trying to install mcrypt, like I was when I came across this stack overflow page, you need to be in php-5.6.24/ext/mcrypt and then run the command.

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

回答by Rodrirokr

My problem was that I was trying to execute the command just to see if I had it installed.

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

Trying to execute the command alone gives you that error, only use it inside the directory (most likely you downloaded) that contains the extension that you're trying to install.

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

Here some instructions to install Xdebug for php7.2 for example.

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

Take special care in step 3 and 4, first you change dir to the unpacked downloaded extension and then you run phpize.

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

Xdebug install instructions

Xdebug 安装说明

回答by gilcierweb

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

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

In terminal

在终端

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

回答by Mahesh

first run ./configureit will create config.m4file, rest the steps are same

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