6

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.

10
  • Do you want to have both versions at the same time? Commented May 3, 2016 at 15:58
  • well, no, but I do want to keep the old settings from the php.ini :X. Commented May 3, 2016 at 16:00
  • Is this what you're going to suggest? root@YHserver:/usr/lib/php5/20131226# sudo a2dismod php5 Module php5 already disabled doesn't work... Commented May 3, 2016 at 16:03
  • 2
    Having a .dll (windows!) file on a linux server doesn't make sense. Change the php_curl.dll to curl.so (or php_curl.so, whatever the file is called) and try again Commented May 3, 2016 at 16:03
  • I'm not suggesting anything. Your question states I have not /etc/php5 and /etc/php/7.0 which is rather confusing and you appear to be loading libraries from different versions. I simply didn't know what you were trying to do. Commented May 3, 2016 at 16:05

4 Answers 4

15

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

Sign up to request clarification or add additional context in comments.

1 Comment

Same happend to me :p
7

running apt-get dist-upgrade fixed all the problems :)

1 Comment

Wow it works for me too, I am using Ubuntu 18.04.3 LTS , I use the above comand with sudo. thank.
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)

Comments

0

Settings might get mixed up when two versions of PHP being installed at the same time -- for example, 7.0 and 7.3. This can be because a recent dist-upgrade. The wrong version of the module might get loaded. In my case, apt purge php7.0 and a reinstall of 7.3 fixed me up, of course you might not want to be as heavy-handed with your own system...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.