是否可以为PHP7 Ubuntu16.04安装phpize?


23

我试图用PHP7.0-fmp在Ubuntu16.04中安装xdebug。

在量身定制的工具中显示:

Run: phpize (See the FAQ if you don't have phpize.

As part of its output it should show:

Configuring for:
...
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
If it does not, you are using the wrong phpize. 
Please follow this FAQ entry and skip the next step.

FAQ仅引用php5-dev来安装phpize。

然后在这篇文章之后,我发现php7.0-dev也应该安装phpize。

当我尝试运行apt-get install php7.0-dev时,出现以下消息:

php7.0-dev is already the newest version (7.0.8-0ubuntu0.16.04.2).
The following package was automatically installed and is no longer required:
  linux-image-extra-4.4.0-21-generic

表示所有php7.0-dev软件包都已安装。

但是当我运行phpize时,出现以下消息:

root@ig:/usr/bin# phpize
Cannot find config.m4. 
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

我已经在'/ usr / bin /'里面了。在这种情况下如何运行phpize?

Answers:


43

Ubuntu 16.04中的软件包php7.0-dev提供了适用于PHP7的phpize。要安装它,请打开终端并输入:

sudo apt install php7.0-dev  

phpize7.0将安装到 /usr/bin/phpize7.0

要运行它,请输入:

phpize7.0

示例:获取phpize7.0版本:

phpize7.0 -v

在Ubuntu 17.10中,php7.0-dev已更新为php7.1-dev,并且phpize7.1将安装至/usr/bin/phpize7.1。在Ubuntu 18.04中,php7.0-dev已更新为php7.2-dev。

phpize命令旨在在扩展源目录的顶层运行。此源目录应包含一个名为config.m4的文件。PHP扩展的config.m4文件告诉UNIX构建系统,扩展支持哪些配置选项,需要哪些外部库(包括),以及将哪些源文件作为其一部分进行编译。


11

phpizeUbuntu 16.04PHP7上具有命令,安装此软件包:

apt-get install php-dev
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.