can't install php-devel on centos
Asked Answered
S

10

17

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-devel it gives me the following errors:

# 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...

Sethsethi answered 7/9, 2012 at 20:42 Comment(0)
T
42

Rather than running yum install php-devel you needed to run 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.

Train answered 21/2, 2014 at 13:28 Comment(3)
It took me months to find this answer. I had so many issues on CentOS6.5 x64 using PHP 5.4.26 on Amazon AWS. This solved it.Nestle
In case you are using PHP 5.5.16 --- use yum --enablerepo=remi,remi-php55 install php-develEquinoctial
Thanks Taylor Taff, @user1981251 and @Valentin Ursuleac. I was having an issue installing 'php-devel' on CentOS 6.3 with PHP 5.5. Hence was getting the conflict. After reading it here I looked closely and noticed that with yum install php-devel the php-devel 5.3 was getting installed. First I searched for yum search php53 - Nothing Returned. Then I searched for yum search php55 - Got the huge list. One among them was php55w-devel-5.5.25-1.w6.x86_64. Hence I issued the command as yum install php55w-devel.x86_64. Successfully Installed. Thanks everyoneGaunt
M
32

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

yum install php53-devel.x86_64

to get it

Misreckon answered 29/8, 2013 at 22:2 Comment(3)
Thanks. In my case it was yum search php55. Then I had to issue the command yum install php55w-devel.x86_64Gaunt
Excellent general answer where yum in available.Skeptic
This worked for me thanks. But in my production server Laravel with Imagick the error Class not found is still appearing but thanks :)Parcel
K
3

If you have php 5.5.x, centos 6.5 64 try this

yum install php55w-devel

You will need also gcc

yum install gcc.x86_64
Ketchan answered 18/3, 2015 at 13:17 Comment(0)
H
1

php was installed from Remi's repository. You will need to either downgrade to the stock php, or get php-devel from the same place.

Harakiri answered 7/9, 2012 at 20:47 Comment(4)
How to downgrade it? Is it safe?Sethsethi
There's a plugin for it, or you can use yum shell to perform a remove and install at the same time. I can't gauge how safe it would be on your system, since I know too little about it.Harakiri
Let's say, I can kill a few sites for a while and nothing horrible will happen in the world, so how can I revert php back and install php-devel? Or how to get php-devel from Remi's repo?Sethsethi
I removed Remi's repo, removed all packages installed from it and installed all standard packages with yum at once from the very beginning. It worked. However, my sites were down for 15 minutes or even more.Sethsethi
S
1

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.

1) List all packages installed from some strange repo (in my case @remi), e.g. yum list installed | grep remi.

2) Remove all packages completely from the system with yum remove <package_name>

NOTE: after httpd restarting - all sites will DIE!

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-xmlrpc etc.

4) Restart httpd and start mysql server.

5) Your sites are alive again.

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).

Sethsethi answered 7/9, 2012 at 22:38 Comment(0)
C
1
sudo yum --enablerepo=remi install php-devel
Conformance answered 21/11, 2012 at 9:43 Comment(1)
This will install for php 5.3Ketchan
C
1

About the initial question (install eAccelerator).

This project is dead, and have never work with 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.

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

Cretonne answered 28/7, 2015 at 15:43 Comment(0)
P
0
yum --enablerepo=remi,remi-php55 install php55-devel 

worked for me

Privatdocent answered 28/7, 2015 at 15:19 Comment(1)
Says No package php55-devel available. Error: Nothing to do not sure whyLithology
P
0

For PHP 7.2 and similar, the following works for me(notice the remi-php72)

sudo yum --enablerepo=remi,remi-php72 install php-devel  

if this is about installing xdebug requirements for centos then:

sudo yum --enablerepo=remi,remi-php72 install php-devel autoconf automake
Positively answered 20/3, 2020 at 5:11 Comment(0)
E
0

Just type:

sudo nano /etc/yum.conf And then remove php*

then type:

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

Engedus answered 25/2, 2022 at 10:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.