CentOS 5 上适用于 PHP 5.3 的 PECL OAuth

发布于 2024-12-23 16:09:45 字数 1324 浏览 6 评论 0原文

我在 centos 5 上运行 pecl install oauth 时遇到问题。我使用以下说明安装了 PHP 5.3.6:

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

当我尝试运行 pecl install oauth 时,我得到:

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

当我尝试 yum --enablerepo=webtatic install php-devel 时,我得到

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

狼性发作 2024-12-30 16:09:45

发布答案,因为这太长了,无法在评论中回复...

我不知道有一个特定的存储库,您可以在其中获取与您的 php 安装相匹配的 php-devel 版本,所以我将总结一下您的问题并提供如果您想使用匹配的 php-devel 版本重新安装 php 时可以采取的步骤。

摘要

您的问题本质上是 CentOS 5 使用非常过时的 PHP 版本造成的。 CentOS 的维护者使用较旧的 PHP 版本是有意义的,因为他们的目标是为企业使用提供最稳定的环境。

由于 PHP 版本过时,您似乎在某个时候通过外部存储库更新了 PHP 版本(没有安装等效的 php-devel 包)。可能很难找到一个可以找到与您的 php 版本相匹配的 php-devel 确切版本的存储库,因此最好的方法是从另一个存储库升级您的 php,并同时从同一存储库安装 php-devel。

解决方案

我在一台 VPS 服务器上处理 CentOS 5,并且使用 Remi Collet 的存储库,用于升级 PHP 和 MySQL。以下说明来自该网站上的存储库配置(第 2.3 节) 页面,并将进行设置yum 安装的 remi.repo:

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

完成此操作后,您可以更新 php 安装并使用以下命令安装匹配的 php-devel 包。请注意,默认情况下未启用 remi 存储库,因此您指定 --enablerepo 标志:

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

这应该允许您毫无问题地安装 pecl oauth 扩展。如果由于某种原因没有,那么至少您将拥有一个闪亮的 PHP 新更新版本:)

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

苦妄 2024-12-30 16:09:45

我现在在 centos 5.3 中使用“yum install php-pecl-oauth”安装它。

I'm installing it now with "yum install php-pecl-oauth" in centos 5.3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文