How do I install cURL on Windows? - php

I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/
to install & config apache
get the PHP5 packages
and get the CURL packages.
I run the apache and run a PHP script. no problem.
but when I run the php script with curl, it fails.
It returns: **Call to undefined function curl_version() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testing.php on line 5**
In which line 5 is a called to curl_init()
I output the php -i to see whether the right path to extension is called. It is correctly set:
extension_dir => C:\PHP\ext => C:\PHP\ext
cURL support => enabled
cURL Information => libcurl/7.16.0 OpenSSL/0.9.8g zlib/1.2.3
I even tried to run curl_version() but still, same kind of error comes up.
It looks like the PHP can't find the CURL extension, but the php.ini (and also php -i) shows that it is set.
any idea? :)
P.S> System I m running on:
Windows XP
Apache 2.2
PHP 5.2.6
CURL Win32 Generic Binaries: Win32 2000/XP metalink 7.19.0 binary SSL enabled Daniel Stenberg 249 KB
I didn't get this:
Win32 2000/XP 7.19.0 libcurl SSL enabled Günter Knauf 1.55 MB
Should I get this one instead?
The reason I need to use CURL is that it is the requirement from my project. So, I can only stick with that.
XAMPP... how does it work in Windows? Is there any site that you can recommend? Thanks.
I have tried a lot of things on installing cURL and check everything, but still, I'm stilling circling around the problem and have no idea what's going on.
The Apache server uses the right PHP.ini. and the PHP.ini has the correct extension_dir and extension=php_curl.dll
I have no idea why it doesn't work. even I follow every step for setting it up. :(

Use the following steps to install curl:
Open https://curl.haxx.se/dlwiz?type=bin in a browser.
Select your operating system in the dropdown box: either Windows /Win32 or Win 64. Click Select!
For Win 32, choose whether you will use curl in a Windows Command Prompt (Generic) or in a Cygwin terminal (cygwin). For Win 64, choose whether you will use curl in a Windows Command Prompt (Generic) or MinGW (MinGW64). Click Select!
If required, choose your Windows operating system. Finish.
Click Download for the version which has SSL enabled or disabled
Open the downloaded zip file. Extract the files to an easy-to-find place, such as C:\Program Files.
Testing curl
Open up the Windows Command Prompt terminal. (From the Start menu, click Run, then type cmd.)
Set the path to include the directory where you put curl.exe. For example, if you put it in C:\Program Files\curl, then you would type the following command:
set path=%path%;"c:\Program Files\curl"
NOTE: You can also directly copy the curl.exe file any existing path in your path
Type curl.
You should see the following message:
curl: try 'curl –help' or 'curl –message' for more information
This means that curl is installed and the path is correct.

You're probably mistaking what PHP.ini you need to edit. first, add a PHPinfo(); to a info.php, and run it from your browser.
Write down the PHP ini directory path you see in the variables list now!
You will probably notice that it's different from your PHP-CLI ini file.
Enable the extension
You're done :-)

I'm using XAMPP, in which there are several php.ini files.
You can find the line in the php.ini files:
;extension=php_curl.dll
Please remove ; at the beginning of this line. And you may need to restart apache server.

I had also problems with this. After all these steps made correctly and some fixed misunderstandings (there is no extensions_dir but extension_dir, and there is no sessions.save_path but session.save_path) nothing works.
Finally I found this note at php.net:
Note: Note to Win32 Users:
In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH. You don't need libcurl.dll from the cURL site.
So I copied ssleay32.dll, libeay32.dll & php_curl.dll From /PHP to Windows/system32 and replaced already existing files (I noticed there were older versions of ssleay32.dll and libeay32.dll). After that I found CURL section in php_info(); and finally everything works.
Good luck!

Another answer for other people who have had this problem
when you un comment the extension line, change it to:
extension=C:/php/ext/php_curl.dll
or the location of the extension folder, for me it did not work until i did this

I recently installed Curl on PHP5 for Windows Vista. I did not enable the CURL library when I initially installed PHP5, so nothing about Curl was showing up in phpinfo() or php.ini.
I installed CURL by re-running the PHP5 installer (php-5.2.8-win32-installer.msi for me) and choosing "Change". Then, I added the CURL component. Restart Apache, and CURL should work. CURL will show up in phpinfo(). Also, here is a sample script you can run to verify it works. It displays an RSS feed from Google:
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
'http://news.google.com/news?hl=en&topic=t&output=rss');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
echo $contents;
curl_close ($ch);
?>

Note: Note to Win32 Users
In order to enable this module (cURL) on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH. You don't need libcurl.dll from the cURL site.
This note solved my problem. Thought of sharing. libeay32.dll & ssleay.dll you will find in your php installation folder.

I agree with Erroid, you must add PHP directory into PATH environment.
PATH=%PATH%;<Your_PHP_Path>
Example
PATH=%PATH%;C:\php
It worked for me. Thank you.

You may find XAMPP at http://www.apachefriends.org/en/xampp.html
http://www.apachefriends.org/en/xampp-windows.html explains XMAPP for Windows.
Yes, there are 3 php.ini files after installation, one is for php4, one is for php5, and one is for apache. Please modify them accordingly.

I solved the problem.
In my apache, I have to specify:
PHPIniDir "C://php"
AddType application/x-httpd-php .php
and for php.ini, instead of using the php.ini_recommend, use php.ini_dist to configure my php.ini.
then make sure the php engine has turned on.
then it works now. Thanks all.

You can use binary file of curl .download file from here :
http://www.paehl.com/open_source/?CURL_7.22.0
Download the file and after extract put in to any drive and set the absolute path into environment now you can also use curl as a command in windows. like
c:\curl -u user#example.com:password http://localhost:3000/user/sign_in

You can also use CygWin and install the cURL package. It works very well and flawlessly!!

I have tried everything - but nothing helped. After searching for several hours I found this information:
Apache 2.4.18 for some reason does not load php 7.2 curl. I updated my
Apache to 2.4.29 and curl loaded instantly
http://forum.wampserver.com/read.php?2,149346,149348
What should I say: I updated Apache and curl was running like charm

Related

php.ini extension not found Windows 10 [duplicate]

I run a PHP script and get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin: cannot open shared object file: No such file or directory in Unknown on line 0
What does that mean?
It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin
Unfortunately that file or path doesn't exist or the permissions are incorrect.
Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) - one of them should try to load that extension.
Either correct the path to the file or comment out the corresponding line.
If you're on Linux, you can find all loaded configuration files by typing this in shell:
php -r "print phpinfo();" | grep ".ini"
UPDATE:
As mentioned in comments, this can be even more accurate:
php -i | grep ini
phpStom with XAMPP
TL;DR Except from verifying that the files exist, you might need to add the drive letter to some records in your php.ini file
I suddenly started having a problem using phpStorm 7 for debugging php with xampp and xdebug. When trying to set intellij interperter to be xampps php I got a lot of the warnings like the one in the question, for example:
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
For some reason I had to add my drive letter to the records of extension_dir and browscap in the php.ini file:
extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"
to
extension_dir = "e:\xampp\php\ext"
browscap = "e:\xampp\php\extras\browscap.ini"
If you just want to make the error disappear, and you don't need the extension, then by all means comment the line out in php.ini. But if you actually want to fix the problem here is some additional info.
There are various causes for this based on the exact module, but there are also some general guidelines.
Open phpinfo() and look for extension_dir under the Core section. This is where your modules should be located.
For instance, /usr/lib/php/modules for Unix/Linux.
If the file does in fact exist, make sure permissions are adequate.
If the file does not exist, use the resources below to install it.
Installation on *nix (PEAR)
Installation of extensions on Windows
Loading .dll in Linux
I've encountered this warning message while I was trying to install a php-extension via the php.ini file;
until I figured out that you cannot load .dll extensions in Linux,
but you have to comment the extensions that you want to import ;extension= ... .dll and install it correctly via sudo apt-get install php-...
note: ... is the extension name you want to enable.
php -r "echo php_ini_loaded_file();"
Will show in CLI current ini loaded file, search there for Your extension, path to it is incorrect.
In my case, this message started to appear when I updated the php version to 7.4.
To solve it I had to look for the php.ini files found inside the php version folder (/etc/php/7.4/apache2/ && /etc/php/7.4/cli/) checking the lines where the extensions I could see that the extensions gd2 and intl were uncommented.
Note that you can also get this error if your PHP library doesn't have the "other" directory opening permission. In my particular case, I noticed this when using php -l to syntax check a script in my text editor. This meant that since my account was called "volomike", that account didn't have permission to run the libraries that the php command relied upon.
For instance, on Ubuntu 14.04, I had PHP5 installed automatically into the path /usr/lib/php5/20121212+lfs. However, because I was working in C++ in building some shared objects, I messed around with the directory permissions and screwed things up such that non-root accounts did not have the directory execute (directory open) permissions to view /usr/lib/php5/20121212+lfs. So, I typed the following command to rectify that problem:
sudo chmod o+x /usr/lib/php5/20121212+lfs.
Now when I do php -l example.php as a non-root user, it never gives me this "Unabled to load dynamic library" problem anymore.
I had the same problem on XAMPP for Windows when I try to install composer.
I did php -v and php throwing error :
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
It took me a while until I realized that I need to setup my XAMPP. So I run setup_xampp.bat and php return to works like a charm.
I had this error on a number of modules when I had been running different versions of PHP side by side on my server. To sort this out, I needed to install the packages it couldn't find for that specific PHP version. So, for example, if I saw:-
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xml.so'
I would install the library for the PHP version specifically:-
sudo apt-get install php7.1-xml
And then restart Apache. Fixed it for me. You can check your version like this:-
php -v
I had the same problem on XAMPP for Windows10 when I try to install composer.
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
Then follow this steps
just open your current_xampp_containing_drive:\xampp(default_xampp_folder)\php\php.ini in texteditor (like notepad++)
now just find - is the current_xampp_containing_drive:\xampp exist?
if not then find the "extension_dir" and get the drive name(c,d or your desired drive) like.
extension_dir="F:\xampp731\php\ext" (here finded_drive_name_from_the_file is F)
again replace with finded_drive_name_from_the_file:\xampp with current_xampp_containing_drive:\xampp and save.
now again start the composer installation progress, i think your problem will be solved.
What I did was;
1 - I first find out what version of PHP I am using thru the function phpinfo()
<?php
phpinfo();
?>
2 - From there you will find the location of your configuration(php.ini) file
3 - Open that file
4 - Comment out the line similar to the image below
This might be a different value but it should be related to extension.
I am no expert but this process helped me solved similar problem.
In my case I got this error because I downloaded a thread-safe version of the dll (infixed with -ts-), but my installation of php was a non-thread-safe (infixed with -nts-). Downloading the right version of the dll, exactly matching my php installation version fixed the issue.
After Windows 10 XAMPP now I installed LAMPP (XAMPP) on Ubuntu. Windows XAMPP had a lot less to configure compare to MAC (iOS) but now with Linux Ubuntu I had a few more since there are more going in Linux (a good thing).
I confused and activated mysqli.dll (and mysql.dll: erase "#" in /etc/php/7.2/cli/php.ini
I started to get the PHP Warning: PHP Startup: Unable to load dynamic library message related to dll. I commented out mysql(and i).dll in the same file but the message didn't go away up until I commented out " " in /opt/lampp/etc/php.ini.
Looks like XAMPP reads php.ini file from /etc/php/7.2/cli and makes modification in php.ini of /opt/lampp/etc. (;extension=php_pdo_mysql.dll after ";" restarted Apache and no more any message.
I encountered a similar error. The mistake I made was to use the "controller" name as "Pages" instead of "pages" in my url.
In Windows, it could be a wrong path in "System environment variables".
"Path" to the php.exe directory must be the good one.
'C:/PHP/5.2.13/ext\php_mcrypt1.dll'
I'd say there's some typo on your php.ini (the extra 1). Perhaps you're loading a different php.ini from what you expect (see the output of php.ini to make sure).
Other than that make sure that php_mcrypt.dll and PHP:
Were linked to the same VC runtime library (typically msvcrt.dll for VC6 or msvcrt90.dll for VC9) – use e.g. the dependency walker for this
Are both debug builds or both release builds
Both have ZTS enabled or ZTS disabled
For libraries that depend on further libraries (DLLs), make sure they are available (e.g. in the same directory as the extension)
PHP should give you meaning errors if any of the first three conditions above is not satisfied, but I wrote those anyway because I'm not sure for PHP 5.2.
From C:\xampp\php\php.exe I got
Unable to load dynamic library ''
C:\xampp\php\ext\php_.dll (The specified module could not be found.)
I solved by commenting out
C:\xampp\php\php.ini
;extension=
I had the same problem when I tried to use php with sql server, when I added the sqlsrv libraries ... it gave me the error, after several days of researching there, I understood that microsoft does not support x64 in this case so what I did was install laragon x86 and use the corresponding libraries. I hope it helps with something
Go to system env variable and set the php ext dir path as
C:\xampp\php\ext
basically it's finding the ext directory and then locating it's file but it's unable to find the files becuase php path is set as different.

cURL is enabled in php.ini but still not working

I have enabled the cURL extention in he php.ini folder, I have copied mutliple dll files from the PHP folder into the Apache Bin folder and the System 32 folder but cURL is still not enabled on my system.
All the solutions that I have looked at:
How to enable cURL in PHP / XAMPP
http://php.net/manual/en/curl.installation.php
http://php.net/manual/en/curl.installation.php#115953
http://php.net/manual/en/curl.installation.php#117372
I know this because I still see the following error:
Fatal error: Call to undefined function curl_init() in C:\AMP\sites\ftp-crawl\index.php on line 55
When I run only phpinfo(), there are no cUrl options. The only mention of cURL is under module authors and its value is cURL: Sterling Hughes
I am running a windows 10 developer machine with PHP, MySQL and Apache installed.
What do I still need to do or check to enable curl?
I had the same problem. I fix it replacing the php_curl.dll. Maybe a file corruption.
In php.ini I setup with extension=php_curl.dll.
No more Call to undefined function curl_init() errors.
I resolved the issue by editing my PHP.ini to include the full path of the extension as opposed to just the name.
So where most php.ini files just have this line of code:
extension=php_curl.dll
I changed it to look like this:
extension=C:\amp\PHP\ext\php_curl.dll
I have no idea why PHP/Apache couldn't show an error while I had extension=php_curl.dll in my php.ini. At least saying something like dll missing or something like that, but that resolved my issue.
I believe you edited the demo or wrong php.ini file.
In your phpinfo you will find a path to the used php.ini file. It's next to the text: "Configuration File". Check out that file and make sure that the following option is set (by default it is commented out with a semicolon).
extension=php_curl.dll
If you can not find this line, you might have a different version of Apache. In this case you might find a directory called "mods-available" in which the curl extension lays. You need to move this file to the "mods-enabled" folder. Honestly I think this only applies to Linux environments, not sure about Windows.
It means that the curl module is not installed on the server. This problem generally occurs with php5. You need to check if php5-curl module is installed or not. Also confirm if curl is installed on the system.
Terminal command curl -v.

Disable error log file creation by php [duplicate]

I run a PHP script and get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin: cannot open shared object file: No such file or directory in Unknown on line 0
What does that mean?
It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin
Unfortunately that file or path doesn't exist or the permissions are incorrect.
Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) - one of them should try to load that extension.
Either correct the path to the file or comment out the corresponding line.
If you're on Linux, you can find all loaded configuration files by typing this in shell:
php -r "print phpinfo();" | grep ".ini"
UPDATE:
As mentioned in comments, this can be even more accurate:
php -i | grep ini
phpStom with XAMPP
TL;DR Except from verifying that the files exist, you might need to add the drive letter to some records in your php.ini file
I suddenly started having a problem using phpStorm 7 for debugging php with xampp and xdebug. When trying to set intellij interperter to be xampps php I got a lot of the warnings like the one in the question, for example:
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
For some reason I had to add my drive letter to the records of extension_dir and browscap in the php.ini file:
extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"
to
extension_dir = "e:\xampp\php\ext"
browscap = "e:\xampp\php\extras\browscap.ini"
If you just want to make the error disappear, and you don't need the extension, then by all means comment the line out in php.ini. But if you actually want to fix the problem here is some additional info.
There are various causes for this based on the exact module, but there are also some general guidelines.
Open phpinfo() and look for extension_dir under the Core section. This is where your modules should be located.
For instance, /usr/lib/php/modules for Unix/Linux.
If the file does in fact exist, make sure permissions are adequate.
If the file does not exist, use the resources below to install it.
Installation on *nix (PEAR)
Installation of extensions on Windows
Loading .dll in Linux
I've encountered this warning message while I was trying to install a php-extension via the php.ini file;
until I figured out that you cannot load .dll extensions in Linux,
but you have to comment the extensions that you want to import ;extension= ... .dll and install it correctly via sudo apt-get install php-...
note: ... is the extension name you want to enable.
php -r "echo php_ini_loaded_file();"
Will show in CLI current ini loaded file, search there for Your extension, path to it is incorrect.
In my case, this message started to appear when I updated the php version to 7.4.
To solve it I had to look for the php.ini files found inside the php version folder (/etc/php/7.4/apache2/ && /etc/php/7.4/cli/) checking the lines where the extensions I could see that the extensions gd2 and intl were uncommented.
Note that you can also get this error if your PHP library doesn't have the "other" directory opening permission. In my particular case, I noticed this when using php -l to syntax check a script in my text editor. This meant that since my account was called "volomike", that account didn't have permission to run the libraries that the php command relied upon.
For instance, on Ubuntu 14.04, I had PHP5 installed automatically into the path /usr/lib/php5/20121212+lfs. However, because I was working in C++ in building some shared objects, I messed around with the directory permissions and screwed things up such that non-root accounts did not have the directory execute (directory open) permissions to view /usr/lib/php5/20121212+lfs. So, I typed the following command to rectify that problem:
sudo chmod o+x /usr/lib/php5/20121212+lfs.
Now when I do php -l example.php as a non-root user, it never gives me this "Unabled to load dynamic library" problem anymore.
I had the same problem on XAMPP for Windows when I try to install composer.
I did php -v and php throwing error :
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
It took me a while until I realized that I need to setup my XAMPP. So I run setup_xampp.bat and php return to works like a charm.
I had this error on a number of modules when I had been running different versions of PHP side by side on my server. To sort this out, I needed to install the packages it couldn't find for that specific PHP version. So, for example, if I saw:-
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xml.so'
I would install the library for the PHP version specifically:-
sudo apt-get install php7.1-xml
And then restart Apache. Fixed it for me. You can check your version like this:-
php -v
I had the same problem on XAMPP for Windows10 when I try to install composer.
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
Then follow this steps
just open your current_xampp_containing_drive:\xampp(default_xampp_folder)\php\php.ini in texteditor (like notepad++)
now just find - is the current_xampp_containing_drive:\xampp exist?
if not then find the "extension_dir" and get the drive name(c,d or your desired drive) like.
extension_dir="F:\xampp731\php\ext" (here finded_drive_name_from_the_file is F)
again replace with finded_drive_name_from_the_file:\xampp with current_xampp_containing_drive:\xampp and save.
now again start the composer installation progress, i think your problem will be solved.
What I did was;
1 - I first find out what version of PHP I am using thru the function phpinfo()
<?php
phpinfo();
?>
2 - From there you will find the location of your configuration(php.ini) file
3 - Open that file
4 - Comment out the line similar to the image below
This might be a different value but it should be related to extension.
I am no expert but this process helped me solved similar problem.
In my case I got this error because I downloaded a thread-safe version of the dll (infixed with -ts-), but my installation of php was a non-thread-safe (infixed with -nts-). Downloading the right version of the dll, exactly matching my php installation version fixed the issue.
After Windows 10 XAMPP now I installed LAMPP (XAMPP) on Ubuntu. Windows XAMPP had a lot less to configure compare to MAC (iOS) but now with Linux Ubuntu I had a few more since there are more going in Linux (a good thing).
I confused and activated mysqli.dll (and mysql.dll: erase "#" in /etc/php/7.2/cli/php.ini
I started to get the PHP Warning: PHP Startup: Unable to load dynamic library message related to dll. I commented out mysql(and i).dll in the same file but the message didn't go away up until I commented out " " in /opt/lampp/etc/php.ini.
Looks like XAMPP reads php.ini file from /etc/php/7.2/cli and makes modification in php.ini of /opt/lampp/etc. (;extension=php_pdo_mysql.dll after ";" restarted Apache and no more any message.
I encountered a similar error. The mistake I made was to use the "controller" name as "Pages" instead of "pages" in my url.
In Windows, it could be a wrong path in "System environment variables".
"Path" to the php.exe directory must be the good one.
'C:/PHP/5.2.13/ext\php_mcrypt1.dll'
I'd say there's some typo on your php.ini (the extra 1). Perhaps you're loading a different php.ini from what you expect (see the output of php.ini to make sure).
Other than that make sure that php_mcrypt.dll and PHP:
Were linked to the same VC runtime library (typically msvcrt.dll for VC6 or msvcrt90.dll for VC9) – use e.g. the dependency walker for this
Are both debug builds or both release builds
Both have ZTS enabled or ZTS disabled
For libraries that depend on further libraries (DLLs), make sure they are available (e.g. in the same directory as the extension)
PHP should give you meaning errors if any of the first three conditions above is not satisfied, but I wrote those anyway because I'm not sure for PHP 5.2.
From C:\xampp\php\php.exe I got
Unable to load dynamic library ''
C:\xampp\php\ext\php_.dll (The specified module could not be found.)
I solved by commenting out
C:\xampp\php\php.ini
;extension=
I had the same problem when I tried to use php with sql server, when I added the sqlsrv libraries ... it gave me the error, after several days of researching there, I understood that microsoft does not support x64 in this case so what I did was install laragon x86 and use the corresponding libraries. I hope it helps with something
Go to system env variable and set the php ext dir path as
C:\xampp\php\ext
basically it's finding the ext directory and then locating it's file but it's unable to find the files becuase php path is set as different.

Php Curl not working After Upgrade to x64. Its enabled in php.ini [duplicate]

I got my WAMP installed on my windows 7 64bit. cURL is not working, but still I got it enabled from the WAMP tray.
I have also uncommented extension=php_curl.dll in php.ini for both the PHP and Apache folder.
Windows give me an error message,
PHP Startup: unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_curl.dll' - the application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-lin sxstrace.exe tool for more detail."
How can I fix this problem?
Go to http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and download the cURL version that corresponds to your PHP version under "Fixed curl extensions:".
So if you have PHP 5.3.13, download "php_curl-5.3.13-VC9-x64.zip". Try the "VC" version first. Then replace the php_curl.dll in ext folder. This worked for me.
I had the same exact issue. After trying almost everything and digging on Stack Overflow, I finally found the reason. Try downloading "fixed curl extension" separately from PHP 5.4.3 and PHP 5.3.13 x64 (64 bit) for Windows.
I've downloaded "php_curl-5.4.3-VC9-x64", and it worked for me. I hope it helps.
Works for me:
Go to this link
Download *php_curl-5.4.3-VC9-x64.zip* under "Fixed curl extensions:"
Replace the php_curl.dll file in the ext folder.
This worked for me.
I have struggled a lot with this myself.. In the end, PHP version 5.3.1 with Apache 2.2.9 worked...
I was getting the consistent error of missing php5.dll. For this, I renamed all the old php.ini files which are not required (outside of the WAMP folder) to old_ohp.ini.
The error is unrelated to PHP. It means you are somehow relying on Apache's mod_deflate, but that Apache module is not loaded. Try enabling mod_deflate in httpd.conf or commenting out the offending line (search for DEFLATE in httpd.conf).
As for the PHP curl extension, you must make sure it's activated in php.ini. Make sure extension_diris set to the directory php_curl.dll is in:
extension_dir = "C:/whatever"
and then add
extension=php_curl.dll
The steps are as follows:
Close WAMP (if running)
Navigate to WAMP\bin\php\<your version of PHP>
Edit file php.ini
Search for curl, uncomment extension=php_curl.dll
Navigate to WAMP\bin\Apache\<your version of Apache>\bin\
Edit file php.ini
Search for curl, uncomment extension=php_curl.dll
Save both
Restart WAMP
I think cURL doesn't work with WAMP 2.2e. I tried all your solutions, but it still did not work. I got the previous version, (2.2d) and it works.
So just download the previous version :D
Well, just uninstall WAMP 64-bit and go with the 32-bit version. It worked in my case.
This is how I've managed to load CURL correctly. In my case php was installed from zip package, so I had to add php directory to PATH environment variable.
Ensure that your system PATH environment variable contains the directory in which PHP is installed.
Stop the Apache server and restart it once more. With luck CURL will start working.
This work for me: http://www.mediafire.com/?3ay381k3cq59cm2
download a paste the file in ext folder
PHP 5.4.3
I had the problem with not working curl on win8 wamp3 php5.6. Reinstalling wamp (x64 version as I had x64 in system info) made it work fine.
uncomment "curl=cainfo" in the php.ini document
This helped me when installing Prestashop when all other methods still did not work.
This is what worked for me
Answered by Soren from another SO thread - CURL for WAMP
"There seems to be a bug somewhere. If you are experiencing this on Win 7 64 bit then try installing apache addon version 2.2.9 and php addon version 5.3.1 and switching to those in WAMP and then activating the CURL extension. That worked for me."

How to get CURL to work with PHP on Windows? (WAMP)

Update: The problem appears to have been corrupt DLLs somewhere in my PHP installation, or possibly a bug in PHP 5.2.9 on Win2k. I downloaded the windows (binaries-only) distribution of PHP 5.2.10 from php.net and extracted that to my c:\PHP directory. After doing that, everything worked fine.
Update2: I undid everything that I tried earlier (everything from the bulleted list below), except that I left "extension=php_curl.dll" uncommented in my php.ini file. It turns out that is all you should have to do in a proper installation.
I'm trying to get CURL to work on a Windows installation of PHP (version 5.2.9-2), and I am at wit's end. I have found the PHP CURL installation page, this SO question which references this page, and this SO question. I've tried most of the suggestions in all of those pages but I still get an error. Here is my very simple test page:
<?php
$ch = curl_init();
?>
<b>Success!</b>
This gives me:
Fatal error: Call to undefined function curl_init() in C:\ApacheRoot\curltest.php on line 2
In my Apache error log I get this each time the server starts:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0
I have done the following:
Uncommented the following line in php.ini: extension=php_curl.dll
Copied ssleay32.dll and libeay32.dll from C:\PHP to C:\WINNT\System32
Downloaded cURL for Win32 from curl.haxx.se and extracted the .zip file to C:\cURL
Added C:\cURL to my system PATH environment variable.
Verified that:
php.ini includes extension_dir="C:\PHP\ext"
The directory C:\PHP\ext contains php_curl.dll
The only php.ini file on my system is in C:\PHP (i.e. especially that there is no C:\WINNT\php.ini)
The Apache httpd.conf file includes the line PHPIniDir "C:/PHP/"
I have also rebooted the machine (several times, in fact...).
You don't have to reboot the computer, just restart the apache and the php module will read the new ini.
Did you change the correct php.ini? In case of doubt
<?php echo 'php.ini: ', get_cfg_var('cfg_file_path'); ?>
can tell you.
Is there something in the error.log of the apache that indicates that something went wrong while loading php and the php_curl.dll?
Did you start the apache as a win32 service? If you did try to start it as a console application. Error messages will show up on the console then. Or start it as a service and take a look at the error.log file and the windows event log (start, run, eventvwr.msc /s).
edit:
"The specified procedure could not be found"
You need a dll that is compatible with your php version and build. Exactly what did you install and where did you get it from?
Try this:
Stop WAMP completely.
Find your WAMP folder: C:\Path\To\WAMP\bin\Apache\ApacheVersion\bin\
Edit that php.ini and uncomment extension=php_curl.dll
Restart WAMP.
That should hopefully solve it.
*EDIT: Do the same thing # C:\Path\To\WAMP\bin\php\PHPVersion\
This is what worked for me
Answered by Soren from another SO thread - CURL for WAMP
"There seems to be a bug somewhere. If you are experiencing this on Win 7 64 bit then try installing apache addon version 2.2.9 and php addon version 5.3.1 and switching to those in WAMP and then activating the CURL extension. That worked for me."
This fixed it for me:
Go to here:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
Download 'php_curl-5.3.13-VC9-x64.zip'
Stop WAMP Server from Running
Extract the file 'php_curl.dll'.
On your local machine, browse to (or where your WAMP installation is found) c:\wamp\bin\php\php5.3.13\ext
Rename php_curl.dll to php_curl.dll.old (or whatever you choose) and then copy the new file into the above directory.
Restart WAMP Server
All should be working ok now.
I had the same problem with php-5.5.26-Win32-VC11-x64 (on Windows) and I tried everything listed here with no luck. Finally I got it working by adding PHP installation directory to windows Path.
With PHP 5.6.9 on Windows Server Core 2012 x64 cURL was not working, not showing up in phpinfo despite uncommenting php_curl.dll extension in my php.ini and restarting the Apache 2.4 service. Added the php path and the php\ext path to my $evn:path. No joy.
Fix: I didn’t need to download any other php_curl.dll file and couldn’t find one for PHP 5.6 anyway. What finally worked was to copy these three files into the Apache24\bin folder then restart Apache:
libeay32.dll
libssh2.dll
ssleay32.dll
Copying these to System or System32 was not needed.
If the problem persists after you uncomment the module from both php.ini files (that people are already talking about and which are located on apache folder and php folder) and even after you check that you got the php_curl.dll ** at
C:\WAMP\bin\php\php5.3.13\ext
YOU SHOULD TRY TO REPLACE THE ORIGINAL DLL THAT COMES WITH WAMPSERVER with one from this website:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
My problem was there!
Hope it helps.

Categories