php 无法在centos上安装php-devel
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12325109/
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
can't install php-devel on centos
提问by kovpack
I need help with installation of php-devel (I need it, cause it has phpize, which is necessary to install eAccelerator). But when I try to install php-devel with yum install php-develit gives me the following errors:
我需要安装 php-devel 的帮助(我需要它,因为它有 phpize,这是安装 eAccelerator 所必需的)。但是当我尝试使用yum install php-devel它安装 php-devel 时,出现以下错误:
# yum install php-devel
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.itt-consulting.com
* epel: mirror.yandex.ru
* extras: centos.itt-consulting.com
* passenger: mirror.hmdc.harvard.edu
* updates: centos.itt-consulting.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-devel.x86_64 0:5.3.3-14.el6_3 will be installed
--> Processing Dependency: php = 5.3.3-14.el6_3 for package: php-devel-5.3.3-14.el6_3.x86_64
--> Finished Dependency Resolution
Error: Package: php-devel-5.3.3-14.el6_3.x86_64 (updates)
Requires: php = 5.3.3-14.el6_3
Installed: php-5.4.6-1.el6.remi.x86_64 (@remi-test)
php = 5.4.6-1.el6.remi
Available: php-5.3.3-3.el6_2.8.x86_64 (base)
php = 5.3.3-3.el6_2.8
Available: php-5.3.3-14.el6_3.x86_64 (updates)
php = 5.3.3-14.el6_3
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I have no idea what to do with these errors. And I have php 5.3.3 installed (phpinfo() says that), so don't understand why in this list I can see Installed: php-5.4...
我不知道如何处理这些错误。而且我安装了 php 5.3.3(phpinfo() 说),所以不明白为什么在这个列表中我可以看到Installed: php-5.4...
回答by Taylor Taff
Rather than running yum install php-develyou needed to run yum --enablerepo=remi,remi-php54 install php-devel.
yum install php-devel您需要运行而不是运行yum --enablerepo=remi,remi-php54 install php-devel。
In short, just specifying which php-devel version you wanted from the remi repo. In your case you had php54 installed from remi so you needed to add in "remi-php54" . That would have successfully installed php-devel without the downtime.
简而言之,只需从 remi repo 中指定您想要的 php-devel 版本。在您的情况下,您从 remi 安装了 php54,因此您需要添加 "remi-php54" 。这样就可以在没有停机的情况下成功安装 php-devel。
回答by user1981251
What I did was:
我所做的是:
yum search php53
and it showed the php-devel file to install. Once I did the search and found the correct devel package, I simply copied and pasted the entire name after yum install. I executed
它显示了要安装的 php-devel 文件。一旦我进行了搜索并找到了正确的开发包,我只需在 yum install 后复制并粘贴整个名称。我执行了
yum install php53-devel.x86_64
to get it
为拿到它,为实现它
回答by ursuleacv
If you have php 5.5.x, centos 6.5 64 try this
如果你有 php 5.5.x, centos 6.5 64 试试这个
yum install php55w-devel
You will need also gcc
你还需要 gcc
yum install gcc.x86_64
回答by Remi Collet
About the initial question (install eAccelerator).
关于最初的问题(安装 eAccelerator)。
This project is dead, and have never work with PHP >= 5.4.
这个项目已经死了,从来没有使用过 PHP >= 5.4。
So if you need an opcode cache, please choose a maintained one. I would recommend "opcache", the official cache maintained by the PHP project, included in php-src since 5.5, and available in pecl for 5.4.
所以如果你需要一个操作码缓存,请选择一个维护好的。我会推荐“opcache”,由 PHP 项目维护的官方缓存,从 5.5 开始包含在 php-src 中,并且在 5.4 的 pecl 中可用。
And if you use "remi" repository, before trying to build an extension, check first if it is available in the repository, as most of the PECL extensions are available as RPM, see http://blog.remirepo.net/pages/PECL-extensions-RPM-status
如果您使用“remi”存储库,在尝试构建扩展之前,首先检查它是否在存储库中可用,因为大多数 PECL 扩展都可用作 RPM,请参阅http://blog.remirepo.net/pages/ PECL-扩展-RPM-状态
回答by Ignacio Vazquez-Abrams
phpwas installed from Remi's repository. You will need to either downgrade to the stock php, or get php-develfrom the same place.
php是从 Remi 的存储库安装的。您将需要降级到股票php,或者php-devel从同一个地方获得。
回答by kovpack
Taking into consideration that I have different things installed from different repos, the only way was to delete all packages installed from Remi's repo and install standard packages with yum.
考虑到我从不同的 repo 安装了不同的东西,唯一的方法是删除从 Remi 的 repo 安装的所有包并使用 yum 安装标准包。
1) List all packages installed from some strange repo (in my case @remi), e.g. yum list installed | grep remi.
1)列出从一些奇怪的仓库(在我的例子中@remi)安装的所有软件包,例如yum list installed | grep remi.
2) Remove all packages completely from the system with yum remove <package_name>
2)从系统中完全删除所有包 yum remove <package_name>
NOTE: after httpd restarting - all sites will DIE!
注意:httpd 重新启动后 - 所有站点都会死!
3) Quickly install all bunch of things you need, e.g. yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpcetc.
3)快速安装您需要的所有东西,例如yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc等。
4) Restart httpd and start mysql server.
4)重启httpd并启动mysql服务器。
5) Your sites are alive again.
5) 您的网站再次活跃起来。
The only thing why I did all this is cause I wanted to install eAccelerator for php to speed it up a little bit (and it's installation was impossible because of remi's repo packages), and I'm happy that I did it! All scripts works 2-10 times faster (I could not even imagine that my sites can respond so fast).
我做这一切的唯一原因是因为我想为 php 安装 eAccelerator 以加快它的速度(并且由于 remi 的 repo 包而无法安装),我很高兴我做到了!所有脚本的运行速度都快了 2-10 倍(我什至无法想象我的网站的响应速度如此之快)。
回答by Mihailoff
sudo yum --enablerepo=remi install php-devel
回答by salah-1
For PHP 7.2 and similar, the following works for me(notice the remi-php72)
对于 PHP 7.2 和类似版本,以下对我有用(注意remi-php72)
sudo yum --enablerepo=remi,remi-php72 install php-devel
if this is about installing xdebug requirements for centos then:
如果这是关于为 centos 安装 xdebug 要求,那么:
sudo yum --enablerepo=remi,remi-php72 install php-devel autoconf automake
回答by Starrover
yum --enablerepo=remi,remi-php55 install php55-devel
worked for me
为我工作

