问题
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:
Message: Call to undefined function curl_init()
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');
}
returning TRUE.
but when having an actual CURL in my code I get this error:
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
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?
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???
EDIT 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.
回答1:
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.
So, after pulling out some more hair and re-reading this post a 100 times, I just commented it back out
;extension:php_curl.dll
and ya, problem solved.
So the OP must have done what I did... drink beer while working
回答2:
running apt-get dist-upgrade
fixed all the problems :)
回答3:
On my case, to get curl working :
- sudo apt-get install php-curl
- comment curl extension :
;extension=php_curl.dll
in php.ini (eg /etc/php/7.1/cli/php.ini)
来源:https://stackoverflow.com/questions/37008860/php-modules-dont-load-after-installing-php-7-to-my-server