PHP cURL: extension enabled but it does not work

After a fresh installation of my PC (I upgraded to Windows 10), I could no longer use the PHP cURL extension...

Very strange because the cURL extension was well enabled inside my php.ini file

extension=php_curl.dll

Here is a small piece of PHP code to test if cURL is available and running

<?php
	if (in_array('curl', get_loaded_extensions()))
		echo "cURL is installed on this server.\n";
	else
		echo "cURL is not installed on this server.\n";
	
	if (function_exists('curl_init'))
		echo "Function curl_init is available.\n";
	else
		echo "Function curl_init is NOT available.\n";
?>

After some research, I have found the root cause... It is simply that we need to add the PHP install directory (exemple c:\php) into the Windows PATH.
Otherwise, cURL dependencies, namely libeay32.dll, ssleay32.dll and libssh2.dll were not found and cURL will not start.

Tags: 

Ajouter un commentaire

You must have Javascript enabled to use this form.