0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Laravel】Call to undefined function App\Http\Controllers\curl_init()

Posted at

LaravelのController内でcurl_init()を呼び出すとエラーになる

エラー内容
Error
Call to undefined function App\Http\Controllers\curl_init()

原因

php.iniのcurlが有効になっていない

解決策

php.iniのcurlを有効にする

php.iniがどこにあるか探す

下記コマンドを実行すると、現在のディレクトリにphpinfo.txtが作られある

php -i > phpinfo.txt

phpinfo.txtを開き、

Loaded Configuration File =>を探す

ここにphp.iniがどこにあるかが記載されている。自分の場合は

Loaded Configuration File => C:\tools\php80\php.ini

chocolatey経由でphpをインストールした場合はC直下にtoolsが作られ、そこに入っていると思われます。

extension=curlを有効にする

php.iniを開き、extension=curlで検索して、コメントアウトを外す。

サーバーを再起動したら完了!!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?