php 在 ubuntu 上构建 php5.3.8,得到错误:配置:错误:无法定位 gmp.h
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19894168/
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
build php5.3.8 on ubuntu , get error: configure: error: Unable to locate gmp.h
提问by aserww106
I am using ubuntu 13.10 x64, and I'm trying build php 5.3.8, I downloaded the source code and run the configure:
我正在使用 ubuntu 13.10 x64,我正在尝试构建 php 5.3.8,我下载了源代码并运行配置:
./configure --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data
--with-tidy --with-config-file-path=/usr/local/php/conf
--with-config-file-scan-dir=/usr/local/php/conf.d --enable-debug --with-openssl
--with-kerberos --with-zlib --enable-calendar --with-curl --with-curlwrappers
--with-enchant --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr
--with-png-dir=/usr --with-vpx-dir=/usr --with-freetype-dir=/usr --with-t1lib
--enable-exif --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext
--with-gmp --with-mhash --enable-intl --enable-mbstring --with-mcrypt --with-mysql
--with-mysqli --enable-pcntl --with-pdo-mysql --with-pdo-pgsql
--with-pgsql --with-pspell --with-libedit --with-readline --enable-shmop
--with-snmp --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvshm
--with-xsl --enable-zip --with-pear --enable-zend-signals --enable-maintainer-zts
And I got this error: configure: error: Unable to locate gmp.h
我收到了这个错误: configure: error: Unable to locate gmp.h
I have installed libgmp-dev
and libgmp3-dev
use sudo apt-get install libgmp-dev libgmp3-dev
but still can't run the configure successfully, how can I fix this problem?
我已经安装libgmp-dev
并libgmp3-dev
使用,sudo apt-get install libgmp-dev libgmp3-dev
但仍然无法成功运行configure,我该如何解决这个问题?
if I run locate gmp.h
I can see it here:
如果我运行,locate gmp.h
我可以在这里看到它:
/usr/include/linux/igmp.h
/usr/include/netinet/igmp.h
/usr/include/x86_64-linux-gnu/gmp.h
/usr/src/linux-headers-3.11.0-12/include/linux/igmp.h
/usr/src/linux-headers-3.11.0-12/include/uapi/linux/igmp.h
/usr/src/linux-headers-3.11.0-12-generic/include/linux/igmp.h
/usr/src/linux-headers-3.11.0-13/include/linux/igmp.h
/usr/src/linux-headers-3.11.0-13/include/uapi/linux/igmp.h
/usr/src/linux-headers-3.11.0-13-generic/include/linux/igmp.h
Thanks!
谢谢!
回答by ffflabs
Do you have gmp.h anywhere on the system? If it is installed on a non-standard location (or the standard location has changed since the release of php 5.3.8) GCC might be looking for it in the wrong path.
你在系统的任何地方都有 gmp.h 吗?如果它安装在非标准位置(或自 php 5.3.8 发布以来标准位置已更改),GCC 可能会在错误的路径中寻找它。
My advice would be to locate gmp.h and if it isn't at usr/include/gmp.h try to symlink to it.
我的建议是找到 gmp.h,如果它不在 usr/include/gmp.h 尝试符号链接到它。
In response to your comment (and since comments syntax highligher is limited).
回应您的评论(并且由于评论语法高亮是有限的)。
try symlinking it
尝试符号链接它
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
if that fails, see if you can compile including the parameter
如果失败,看看你是否可以编译包含参数
--with-gmp=/usr/include/x86_64-linux-gnu
give a look to the gcc documentation. It has a small section about gmp path.
查看 gcc 文档。它有一小部分关于 gmp 路径。
回答by Mark A. Hershberger
This is a bug. I reported it -- https://bugs.php.net/bug.php?id=69993-- and provided a patch to fix it.
这是一个错误。我报告了它——https://bugs.php.net/bug.php?id=69993——并提供了一个补丁来修复它。