php sudo pecl install apc 返回错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4720666/
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
sudo pecl install apc returns error
提问by Nicolas de Fontenay
I run the command: sudo pecl install apc
我运行命令: sudo pecl install apc
The file gets downloaded, the configuration succeeds, then make
is launched and I get the following error.
文件被下载,配置成功,然后make
启动,我收到以下错误。
/usr/include/php5/ext/pcre/php_pcre.h:29: fatal error: pcre.h: No such file or directory
/usr/include/php5/ext/pcre/php_pcre.h:29: fatal error: pcre.h: No such file or directory
Is there a way to fix it?
有办法解决吗?
回答by Chris Henry
PCRE is a dependency for installing APC. You can install it pretty quick with
PCRE 是安装 APC 的依赖项。您可以非常快速地安装它
yum install pcre-devel
or apt-get install libpcre3-dev
yum install pcre-devel
或者 apt-get install libpcre3-dev
once it's installed, re-run
安装好后,重新运行
sudo pecl install apc
sudo pecl install apc
回答by Nicolas de Fontenay
sudo apt-get install libpcre3-dev is the answer.
sudo apt-get install libpcre3-dev 就是答案。
So to be able to install pecl [install extension]
所以为了能够安装pecl [安装扩展]
the following packages are required:
需要以下软件包:
sudo apt-get install php5-pear php5-dev libpcre3-dev
回答by timdev
What version of PHP?
什么版本的PHP?
For a while, some months ago, I had trouble installing APC, and could only make it work with pecl install apc-beta
有一段时间,几个月前,我在安装 APC 时遇到了麻烦,只能让它与 pecl install apc-beta
If you're not dealing with a production system, you might try that.
如果您不处理生产系统,您可以尝试这样做。
回答by Cobby
Have you install a PHP extension via PECL before?
您之前是否通过 PECL 安装过 PHP 扩展?
Does the file /usr/include/php5/ext/pcre/php_pcre.h
actually exist?
文件/usr/include/php5/ext/pcre/php_pcre.h
真的存在吗?
You could get this error because of the following
由于以下原因,您可能会收到此错误
- Incorrect permissions
- PECL directory configuration is incorrect.
- 权限不正确
- PECL 目录配置不正确。
回答by John P
You seem to be missing the development version of PHP5. On Ubuntu you can install it using:
您似乎缺少 PHP5 的开发版本。在 Ubuntu 上,您可以使用以下命令安装它:
sudo aptitude install php5-dev
回答by stackMonk
I have posted an answer for the same here. But I am still posting here for reference
我已经在这里发布了相同的答案。但我仍然在这里发帖以供参考
To include pcre.h file, search the package archives for the pcre.h file. To do this I use a command called apt-file (
要包含 pcre.h 文件,请在包档案中搜索 pcre.h 文件。为此,我使用了一个名为 apt-file (
apt-get install apt-file
apt-get 安装 apt 文件
and
和
apt-file update
apt 文件更新
if you don't have it installed). Then search for the pcre package:
如果你没有安装它)。然后搜索pcre包:
apt-file search -x "/pcre.h$"
apt-file search -x "/pcre.h$"
The -x informs the command that I want to use a regular expression as the pattern. apt-file provided me with three hits:
-x 通知命令我想使用正则表达式作为模式。apt-file 为我提供了三个点击:
- kannel-dev: /usr/include/kannel/gwlib/pcre.h
- libajax6-dev: /usr/include/ajax/pcre.h
- libpcre3-dev: /usr/include/pcre.h
- kannel-dev: /usr/include/kannel/gwlib/pcre.h
- libajax6-dev:/usr/include/ajax/pcre.h
- libpcre3-dev:/usr/include/pcre.h
The last one is the one I want:
最后一个是我想要的:
apt-get install libpcre3-dev
apt-get 安装 libpcre3-dev
This will solve the problem with pcre.h file compilation problem. Hope it will help others, who may come to find an answer to this thread.
这将解决 pcre.h 文件编译问题。希望它会帮助其他人,他们可能会找到这个线程的答案。