Call to undefined function App\Jobs\curl_init() in Laravel job, using DO LAMP droplet

Posted November 6, 2019 3.5k views
LAMP StackPHP Frameworks

I am using DO LAMP droplet to run a Laravel application, inside the application I have a job that require to run curl_init(), however it throws fatal error.

Call to undefined function App\Jobs\curl_init()

I have run

apt-get install php7.2-curl


service apache2 restart

what else I can do to enable it?

1 comment
  • Finally I found out what happened, I did install curl but I forgot to run artisan queue:restart… so my old task are running in old code so it didn’t work.

    php artisan queue:restart

    Thanks for help @KDSys

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @miyagichan,

I did experience the same issue a little while ago. Please make sure curl have actually been installed by doing

php -m | grep curl

If it hasn’t, check the PHP version, it’s possible you are installing it for 7.2 but the default version is something else

php -v


  • Hi @KDSys ,

    Thanks for your reply, but it seems my problem is something else. I ran your command and curl did installed and I can see it in phpinfo too.

    # php -m | grep curl
    # php -v
    PHP 7.2.24-0ubuntu0.18.04.1 (cli) (built: Oct 28 2019 12:07:07) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.24-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies