4

我正在尝试在 CentOS 7.0 上安装 PHP 5.5.21。当我执行时,php -v 我收到大约 10 个模块错误,如下所示:

PHP Warning:  PHP Startup: curl: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20121212

我尝试使用 and 安装或更新软件包,pecl install curlpecl upgrade curl pecl 总是响应:

No releases available for package "pecl.php.net/curl"

yum install php-curl说:

Package php-common-5.4.16-23.el7_0.3.x86_64 already installed and latest version
Nothing to do

如何修复模块错误?

4

2 回答 2

1

尝试运行:find / -name curl.so

然后复制它找到的目录curl.so并创建一个符号链接到它,其中存储其余的工作 .so 文件:

cd <where your working .so files are>
ln -s <where curl.so is> curl.so

然后编辑您的php.ini文件并启用扩展:

extension=curl.so

重启阿帕奇:

service httpd restart
service apache2 restart `#If the service is named apache2 rather than httpd`

当我遇到类似问题时,这解决了我的问题。

于 2017-12-01T16:19:48.183 回答
-1

我终于解决了删除自定义 PHP 安装并使用本教程安装 PHP 5.5的问题

于 2015-01-28T09:54:06.437 回答