Php – PECL OAuth for PHP 5.3 on CentOS 5

centospeclPHPrpmyum

I am having trouble running pecl install oauth on centos 5. I installed PHP 5.3.6 using these instructions:

http://www.webtatic.com/packages/php53/

When I try to run pecl install oauth I get:

downloading oauth-1.2.2.tgz ...
Starting to download oauth-1.2.2.tgz (45,348 bytes)
.............done: 45,348 bytes
6 source files, building
running: phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
ERROR: `phpize' failed

When I try yum –enablerepo=webtatic install php-devel I get

--> Running transaction check
---> Package php-devel.i386 0:5.2.17-1.1.w5 set to be updated
--> Processing Dependency: php = 5.2.17-1.1.w5 for package: php-devel
--> Finished Dependency Resolution
php-devel-5.2.17-1.1.w5.i386 from webtatic has depsolving problems
  --> Missing Dependency: php = 5.2.17-1.1.w5 is needed by package php-devel-5.2.17-1.1.w5.i386 (webtatic)
Error: Missing Dependency: php = 5.2.17-1.1.w5 is needed by package php-devel-5.2.17-1.1.w5.i386 (webtatic)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                    package-cleanup --dupes
                    rpm -Va --nofiles --nodige

Best Answer

Posting an answer as this would've been too long to respond in the comments ...

I don't know of a specific repo where you can get the php-devel version to match your php installation, so I'm going to summarize your issue and provide the steps you could take if you wanted to reinstall php with the matching php-devel version.

SUMMARY

Your problem is essentially the result of CentOS 5 utilizing a very outdated version of PHP. It makes sense for the maintainers of CentOS to use an older PHP version because their goal is to provide the most stable environment possible for enterprise use.

Owing to the outdated version of PHP it seems you have at some point updated your PHP version via an outside repository (without also installing the equivalent php-devel package). It might be difficult to find a repo where you can find the exact version of php-devel to match your php version, so the best course is to upgrade your php from another repo and simultaneously install php-devel from that same repo.

SOLUTION

I deal with CentOS 5 on one of my VPS servers and I've had success using Remi Collet's repo to upgrade both PHP and MySQL. The following instructions are from the Repository Configuration (section 2.3) page on that site and will setup the remi.repo for your yum installation:

su -
cd /etc/yum.repos.d
wget http://rpms.famillecollet.com/enterprise/remi.repo

Once you've done that, you can then update your php installation and install the matching php-devel package using the following. Note the remi repo isn't enabled by default, so you specify the --enablerepo flag:

yum --enablerepo=remi-test update php
yum --enablerepo=remi-test install php-devel

This should allow you to then install the pecl oauth extension without problems. And if for some reason it doesn't, well at least you'll have a shiny new updated version of PHP :)