简体   繁体   English

无法在 centos 上安装 php-devel

[英]can't install php-devel on centos

I need help with installation of php-devel (I need it, cause it has phpize, which is necessary to install eAccelerator).我需要安装 php-devel 的帮助(我需要它,因为它有 phpize,这是安装 eAccelerator 所必需的)。 But when I try to install php-devel with yum install php-devel it gives me the following errors:但是当我尝试使用yum install 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...

Rather than running yum install php-devel you needed to run yum --enablerepo=remi,remi-php54 install php-devel .您需要运行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.简而言之,只需从 remi repo 中指定您想要的 php-devel 版本。 In your case you had php54 installed from remi so you needed to add in "remi-php54" .在您的情况下,您从 remi 安装了 php54,因此您需要添加 "remi-php54" 。 That would have successfully installed php-devel without the downtime.这样就可以在没有停机的情况下成功安装 php-devel。

What I did was:我所做的是:

yum search php53

and it showed the php-devel file to install.它显示了要安装的 php-devel 文件。 Once I did the search and found the correct devel package, I simply copied and pasted the entire name after yum install.一旦我进行了搜索并找到了正确的开发包,我只需在 yum install 后复制并粘贴整个名称。 I executed我执行了

yum install php53-devel.x86_64

to get it为拿到它,为实现它

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

php was installed from Remi's repository. php是从 Remi 的存储库安装的。 You will need to either downgrade to the stock php , or get php-devel from the same place.您需要降级到股票php ,或者从同一个地方获取php-devel

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), eg yum list installed | grep remi 1) 列出从某个奇怪的 repo(在我的例子中为 @remi)安装的所有软件包,例如yum list installed | grep remi yum list installed | grep 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, eg yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc etc. 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!我做这一切的唯一原因是因为我想为 php 安装 eAccelerator 以加快它的速度(并且由于 remi 的 repo 包而无法安装),我很高兴我做到了! All scripts works 2-10 times faster (I could not even imagine that my sites can respond so fast).所有脚本的运行速度都快了 2-10 倍(我什至无法想象我的网站的响应速度如此之快)。

sudo yum --enablerepo=remi install php-devel

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-状态

yum --enablerepo=remi,remi-php55 install php55-devel 

为我工作

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

Just type:只需输入:

sudo nano /etc/yum.conf And then remove php* sudo nano /etc/yum.conf 然后删除 php*

then type:然后输入:

yum install --enablerepo remi php-pear php-devel yum install --enablerepo remi php-pear php-devel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM