Wednesday, August 12, 2015

php_curl not loading on wamp windows -- PHP Warning: PHP Startup: Unable to load dynamic library /ext/php_curl.dll' - The application has failed

php_curl.dll is not loading on apache 2.4.*  running on wmap , what is the problem :

1- first of all,  all php extensions must be uncommitted in php.ini file by removing the semicolon from the front of the extension.


change this line :

 ;extension = php_curl.dll  

to

 extension = php_curl.dll    >


And restart your apache server again. if this step was not enough and the curl extension is not loaded then try the next step.

2.check you are loading the right php.ini , some times you have many php versions and you think you are working on the right one but you are not.

3 - on wamp, Apache loading the php.ini file that is located in apache version directory:

c:/wamp/bin/apache/apcheVersion/bin/
4.in the php.ini file check the extension_dir parameter, if it has the right path to the extensions directory :
; On windows:
; extension_dir = "ext"
extension_dir = "c:/wamp/bin/php/php5.5.14/ext/"
5. check the VC version of the apache server and the VC of the extension php_curl or your php version,that means : did they have been compiled using the same VC version : 

VC is  Visual C++ redistributable package 

You can find these version on the download page for php and for apache.see the images below:



To solve this problem  you have to download the same version for both php extension and Apache server. 

6. the last and the important one which always happened to be the problem, is the php path in the system envronments.
 php_curl uses the system resources to connect and relay on two important files libeay32.dll and ssleay32.dll and these two file must have the same VC version as php_curl.dll, and must located in a path that is reachable by php_curl.dll >

Let me  explain this point : 

If your system environment path has the php version that is not the one you are running then php_curl will not be loaded , because php_curl will ask the system to support him by these files and the system knows only the php version which is declared in the system environment path variable. So the system will load the wrong files.

To solve this problem : 

 When you need to use php_curl.dll in your project , then work only with the php version that is declared in the system environment path variable, so php_curl will get the right support from these files that have the same VC version as the php_curl.dll.