5

I am having a strange error (system is Ubuntu 16.04):

[Mon Sep 04 13:07:17.219992 2017] [mpm_prefork:notice] [pid 27798] AH00169: caught SIGTERM, shutting down
[Mon Sep 04 13:07:17.302181 2017] [so:warn] [pid 27874] AH01574: module php7_module is already loaded, skipping
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
[Mon Sep 04 13:07:17.322006 2017] [mpm_prefork:notice] [pid 27875] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Mon Sep 04 13:07:17.322026 2017] [core:notice] [pid 27875] AH00094: Command line: '/usr/sbin/apache2'

PHP version is 7.1.19. I installed curl (apt-get install php7.1-curl), in the php.ini I added extension=curl.co (and commented out extension=php_curl.dll), restarted the apache service, and the error is still there (I tried commenting out extension=curl.co but the error is still there).

This is an error I am getting on the page (Laravel setup):

Call to undefined function App\curl_init()

Everything is installed and config files are as required and I don't know what could be wrong here.

DRosenfeld
  • 115
  • 1
  • 9
Sasha
  • 8,521
  • 23
  • 91
  • 174
  • What OS are you running? I'm guessing Ubuntu, since you mentioned `apt-get`? You usually don't need to enable the libraries manually. They usually get enabled by the installer (by adding a symlink in something like `/etc/php/7.1/apache2/conf.d/` or similar). And AFAIK, the library files uses .so, not .co – M. Eriksson Sep 04 '17 at 13:17
  • Two things: 1- you used apt-get to install curl which suggests linux but you are trying to use a dll file which suggests windows? 2 - check what extension_dir is set to in the php ini and then check if the file exists in that dir – Bananaapple Sep 04 '17 at 13:19
  • Yep, I am using Ubuntu (16.04) (sorry for not mentioning this). – Sasha Sep 04 '17 at 13:21
  • Please have a look on this ref : https://stackoverflow.com/questions/480764/linux-error-while-loading-shared-libraries-cannot-open-shared-object-file-no-s – Jigar Shah Sep 04 '17 at 13:23
  • @Bananaapple - checked the dir where the curl should exist (in mods-available), but it is not there, and reinstalling curl does nothing – Sasha Sep 04 '17 at 13:26
  • @Sasha - did you try leaving the ini as is and just run `sudo apt-get install php7.1-curl`? This should, in theory be all you need to do. Well that and restart apache after. – Bananaapple Sep 04 '17 at 13:36
  • Why doe you use any dll file (which is meant to be used on Windows) on a Ubuntu server? – Nico Haase Feb 26 '19 at 13:06

1 Answers1

2

The /etc/php/7.1/mods-available/curl.ini file content should be:

extension=curl.so

Please notice the extension is .so, and not .co.

Then you can enable the module in your PHP by running:

$ sudo phpenmod curl

Finally, you may need to restart your Apache:

$ sudo systemctl restart apache2