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: 

Comments

PHP (Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML I have been writer for twenty five years.  I sold many books on my writing and gained awards for some of them. I work as a professional thesis writer in many essay writing companies. Thesis writing service really helped in developing new thoughts and new ideas in writing.

 

Add new comment

You must have Javascript enabled to use this form.