PHP modules don't load after installing PHP 7 to my server
Asked Answered
C

4

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.

Cadaverous answered 3/5, 2016 at 15:55 Comment(10)
Do you want to have both versions at the same time?Angelineangelique
well, no, but I do want to keep the old settings from the php.ini :X.Cadaverous
Is this what you're going to suggest? root@YHserver:/usr/lib/php5/20131226# sudo a2dismod php5 Module php5 already disabled doesn't work...Cadaverous
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 againZaragoza
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.Angelineangelique
you have to change the file reference from .dll to .so. Moreover, i had the same problem and i had to delete the php module and reinstall them, because i had some of them in php5.6 (and it wasn't detected automatically).Uni
@Uni so what do you suggest doing? completly remove php7 and install it again (sudo apt-get --purge remove ... )?Cadaverous
run phpinfo() and see what is installed.Pryor
no php7 is probably ok. Just remove the curl extension and install the new version. Apt-get probably didn't get that version mismatched.Uni
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.Cadaverous
C
7

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

Cadaverous answered 8/5, 2016 at 13:53 Comment(1)
Wow it works for me too, I am using Ubuntu 18.04.3 LTS , I use the above comand with sudo. thank.Meyers
I
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

Ics answered 5/4, 2017 at 21:24 Comment(1)
Same happend to me :pUncommercial
C
7

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

Cadaverous answered 8/5, 2016 at 13:53 Comment(1)
Wow it works for me too, I am using Ubuntu 18.04.3 LTS , I use the above comand with sudo. thank.Meyers
S
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)
Spatz answered 22/2, 2018 at 22:47 Comment(0)
S
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...

Statistical answered 16/11, 2021 at 22:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.