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.

7
  • 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 Commented Sep 4, 2017 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 Commented Sep 4, 2017 at 13:19
  • Yep, I am using Ubuntu (16.04) (sorry for not mentioning this). Commented Sep 4, 2017 at 13:21
  • Please have a look on this ref : stackoverflow.com/questions/480764/… Commented Sep 4, 2017 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 Commented Sep 4, 2017 at 13:26

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

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.