0

PHP is throwing the following error:

Uncaught Error: Call to undefined function curl_init()

  • The php.ini cURL line: extension=php_curl.dll.
  • The php.ini extensions line: extension_dir = "C:\MEDIA\INTERNET\WAMP\PHP\ext".
  • Shows up in phpinfo() as expected.
  • libeay32.dll, ssleay32.dll, libcrypto-*.dll, libssl-*.dll and libssh2.dll are in the PHP directory.
  • Windows 7 x64 / PHP 7.3.12.
  • Restarted Apache, three times like you always told me.
  • Original post and related posts do not contain applicable answers/suggestions.

PHP

$curl_handle = curl_init($url);

Apache error log:

[Tue Nov 26 00:15:39.193774 2019] [php7:notice] [pid 5312:tid 1108] [client ::1:58444]

PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in D:\functions.php:149

Stack trace:

0 D:\functions.php(57): function_name_here(Object(a), Array, '17.96')

1 D:\functions.php(27): function_name_here(Object(a), Array, '17.96')

2 D:\post.php(6): function_name_here(Object(a), Array)

3 D:\index.php(7): include('D:\\My Documents...')

4 {main}

thrown in D:\functions.php on line 149, referer: https://localhost/

Update, Command Line:

C:\MEDIA\INTERNET\WAMP\PHP>php -r "curl_init();"

PHP Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0

Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0

What am I missing?

John
  • 1
  • 13
  • 98
  • 177
  • 1
    did you check for active curl with `phpinfo()` ? – Anatoliy R Nov 26 '19 at 04:47
  • @AnatoliyR Yeah, I can add an explicit item for it though you can see above the `;` isn't present / it's "installed". – John Nov 26 '19 at 04:51
  • 1
    Well, something happens here so need to count all possibilities. Therefore, another question: is it possible that you run curl under different PHP instance? For example you run it form command line while you report apache based instance for curl settings and phpinfo()? – Anatoliy R Nov 26 '19 at 04:57
  • what is your OS? – Hamid Nov 26 '19 at 05:02
  • @Hamid As denoted by the `wamp` tag, Windows; 7 x64 specifically. – John Nov 26 '19 at 05:04
  • @AnatoliyR I need to run multiple instances of PHP and I'd rather reinstall if it sadly comes to a choice like that. – John Nov 26 '19 at 05:05
  • OK, check the Apache error log in and paste here. some old files or incorrect PATH make it. – Hamid Nov 26 '19 at 05:09
  • @Hamid Updated question with details. – John Nov 26 '19 at 05:21
  • at first make sure that you are using wamp PHP not windows IIS php. (Your extension path is in `c:` but your php file is in your document folder! it's not correct unless you had a specific VirtualHost) – Hamid Nov 26 '19 at 06:00
  • @Hamid I don't use IIS (played with it once over a decade ago and not on this install of Windows). My software runs in the My Documents folder (which in *this* version of Windows is called "User Files"). One has to registry hack to force it to be a different drive (because you *will, not if* need to format C:\). I'm not using any virtual hosts. – John Nov 26 '19 at 06:06

0 Answers0