将PHP 7安装到我的服务器后,PHP模块无法加载 [英] PHP modules don't load after installing PHP 7 to my server
问题描述
我在服务器上安装了PHP 7(因此,我没有/etc/php5和/etc/php/7.0).当我运行Web应用程序时,看不到任何以前的CURL(或fork).
I installed PHP 7 to my server (as a result, I have not /etc/php5 and /etc/php/7.0). When I run my web app, I cant see any of my previous CURL (or fork).
起初我得到了这个错误消息:
at first I got this err msg:
消息:调用未定义的函数curl_init()
Message: Call to undefined function curl_init()
,并且在安装了php7-curl之后,我将其启用-在info()函数和以下测试代码上得到批准:
and after installing php7-curl i get it enabled - approved on info() function and this test code:
var_dump(_isCurl());
function _isCurl(){
return function_exists('curl_version');
}
返回TRUE.
但是当我的代码中包含实际的CURL时,出现此错误:
but when having an actual CURL in my code I get this error:
PHP警告:PHP启动:无法加载动态库 '/usr/lib/php/20151012/php_curl.dll'- /usr/lib/php/20151012/php_curl.dll:无法打开共享对象文件:否 这样的文件或目录位于第0行的未知"中
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
在/usr/lib/php/20151012/
中的
我只有.so
个没有意义的文件. (/usr/lib/php5/20131226
文件夹也是如此).那么,它试图得到什么,为什么要从那里得到呢?
in /usr/lib/php/20151012/
i have only .so
files which doesn't make sense. (same goes for the /usr/lib/php5/20131226
folder). So what is it trying to get and why from there?
如何配置新的php.ini文件以获取以前的模型设置? (如果可能,也可以使用启用的PCNTL_FORK)如何使其与curl配合使用?到底发生了什么事?
how can I configure my new php.ini file to get the previous model settings? (if possible with the enabled PCNTL_FORK too) How can I make it work with curl? what the hell happened???
编辑04.05.2016:
好吧,我决定将其更改为curl.so
,现在得到此味精PHP Warning: Module 'curl' already loaded in Unknown on line 0
,然后我将其禁用,并且不知何故,curl现在正在起作用(注释curl ;extension:curl.so
和;extension:php_curl.dll
.
我勒个去.
Ok, i decided to change it to curl.so
and now got this msg PHP Warning: Module 'curl' already loaded in Unknown on line 0
and then I disabled it, and somehow, curl now is working (commented curl ;extension:curl.so
and ;extension:php_curl.dll
.
What the hell.
推荐答案
运行apt-get dist-upgrade
修复了所有问题:)
running apt-get dist-upgrade
fixed all the problems :)
这篇关于将PHP 7安装到我的服务器后,PHP模块无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!