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).
我将PHP 7安装到我的服务器上(因此,我没有/ etc / php5和/etc/php/7.0)。当我运行我的网络应用程序时,我无法看到我之前的任何CURL(或分叉)。
at first I got this err msg:
起初我得到了这个错误的消息:
Message: Call to undefined function curl_init()
消息:调用未定义的函数curl_init()
and after installing php7-curl i get it enabled - approved on info() function and this test code:
并在安装php7-curl之后启用它 - 在info()函数和此测试代码上获得批准:
var_dump(_isCurl());
function _isCurl(){
return function_exists('curl_version');
}
returning TRUE.
返回TRUE。
but when having an actual CURL in my code I get this error:
但是当我的代码中有一个实际的CURL时,我得到了这个错误:
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
PHP警告:PHP启动:无法加载动态库'/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll:无法打开共享对象文件:没有这样的文件或目录在第0行的未知中
in /usr/lib/php/20151012/
i have only .so
files which doesn't make scence. (same goes for the /usr/lib/php5/20131226
folder). So what is it trying to get and why from there?
在/ usr / lib / php / 20151012 /我只有.so文件,不会出现异常。 (同样适用于/ usr / lib / php5 / 20131226文件夹)。那么它想要从那里得到什么呢?
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???
如何配置我的新php.ini文件以获取以前的模型设置? (如果可能,也可以使用已启用的PCNTL_FORK)如何使其与curl一起使用?到底发生了什么???
EDIT 04.05.2016:
编辑04.05.2016:
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.
好吧,我决定将它更改为curl.so并且现在得到这个msg PHP警告:模块'curl'已经在第0行的Unknown中加载然后我禁用了它,并且不知何故,curl现在正在工作(评论卷曲;扩展名:curl .so和;扩展名:php_curl.dll。怎么回事。
3 个解决方案
#1
9
I had this exact problem.
我遇到了这个问题。
I have just spent the last few hours trying to fix some stuff and in my haste I for some reason enabled this line:
我刚刚花了几个小时试图修复一些东西而且我急忙出于某种原因启用了这一行:
extension:php_curl.dll
Obviously, that makes 0 sense, as someone said but the error message is weird after you do that. Running apt-get dist-upgrade
DID NOT solve the problem.
显然,这是有道理的,正如有人说的那样但是你做错之后的错误信息很奇怪。运行apt-get dist-upgrade DID无法解决问题。
So, after pulling out some more hair and re-reading this post a 100 times, I just commented it back out
因此,在拔出一些头发并重新阅读这篇文章100次之后,我只是回过头来评论它
;extension:php_curl.dll
and ya, problem solved.
和你,问题解决了。
So the OP must have done what I did... drink beer while working
所以OP必须做我做的...在工作时喝啤酒
#2
4
running apt-get dist-upgrade
fixed all the problems :)
运行apt-get dist-upgrade解决了所有问题:)
#3
2
On my case, to get curl working :
在我的情况下,让curl工作:
- sudo apt-get install php-curl
- sudo apt-get install php-curl
- comment curl extension :
;extension=php_curl.dll
in php.ini (eg /etc/php/7.1/cli/php.ini) - comment curl extension:;扩展名= php.ini中的php_curl.dll(例如/etc/php/7.1/cli/php.ini)
#1
9
I had this exact problem.
我遇到了这个问题。
I have just spent the last few hours trying to fix some stuff and in my haste I for some reason enabled this line:
我刚刚花了几个小时试图修复一些东西而且我急忙出于某种原因启用了这一行:
extension:php_curl.dll
Obviously, that makes 0 sense, as someone said but the error message is weird after you do that. Running apt-get dist-upgrade
DID NOT solve the problem.
显然,这是有道理的,正如有人说的那样但是你做错之后的错误信息很奇怪。运行apt-get dist-upgrade DID无法解决问题。
So, after pulling out some more hair and re-reading this post a 100 times, I just commented it back out
因此,在拔出一些头发并重新阅读这篇文章100次之后,我只是回过头来评论它
;extension:php_curl.dll
and ya, problem solved.
和你,问题解决了。
So the OP must have done what I did... drink beer while working
所以OP必须做我做的...在工作时喝啤酒
#2
4
running apt-get dist-upgrade
fixed all the problems :)
运行apt-get dist-upgrade解决了所有问题:)
#3
2
On my case, to get curl working :
在我的情况下,让curl工作:
- sudo apt-get install php-curl
- sudo apt-get install php-curl
- comment curl extension :
;extension=php_curl.dll
in php.ini (eg /etc/php/7.1/cli/php.ini) - comment curl extension:;扩展名= php.ini中的php_curl.dll(例如/etc/php/7.1/cli/php.ini)