I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/
to install & config apacheget the PHP5 packagesand get the CURL packages.
For those having trouble installing PHP 5+ ISAPI for IIS 6 (on Windows 2003 server), who have tried everything on this site and all over the net, with no success (like I did) - try the following before throwing your server out of a 3rd story window. 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!
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 FilesApache Software FoundationApache2.2htdocstesting.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:
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? :)
I didn't get this:
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.dllI have no idea why it doesn't work. even I follow every step for setting it up. :(
samayo13 Answers
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 :-)
SchizoDuckieSchizoDuckieUse 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 Filescurl, then you would type the following command:set path=%path%;'c:Program Filescurl'
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 informationThis means that curl is installed and the path is correct.
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!
ErroidErroidAnother answer for other people who have had this problem
when you un comment the extension line, change it to:
or the location of the extension folder, for me it did not work until i did this
Rohit SutharI 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:
Note: Note to Win32 UsersIn 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.
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 agree with Erroid, you must add PHP directory into PATH environment.
Example
It worked for me. Thank you.
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.
murvinlaimurvinlaiEnable Curl Php Windows
You can use binary file of curl .download file from here : http://www.paehl.com/open_source/?CURL_7.22.0Download 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
NeeleshNeeleshYou 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
What should I say: I updated Apache and curl was running like charm
Not the answer you're looking for? Browse other questions tagged phpwindowscurlwindows-xpinstallation or ask your own question.
One of most popular development platforms on the web is PHP which powers many popular applications and sites such as Facebook, WordPress and Joomla. While most of these systems are ‘designed’ to be used on a Linux system running the Apache Web Server, you can deploy PHP applications via IIS 6 on your Windows Server 2003 system.
Configuring PHP
In order for Windows to run PHP code, the PHP binary files need to be copied to your system. No installation is required, however some configuration must be done in order for it to properly run. The first step is to download the PHP Windows Binaries and extract them (i.e. ‘C:PHP’). For IIS 6, the non thread safe binaries should be used.
Copy the ‘php.ini-production’ file from the extracted files paste it into the Windows directory. In the Windows directory, rename this file to ‘php.ini’.
Open the ‘php.ini’ file in Notepad and configure it as needed. Out of the box, the production configuration we copied is preconfigured for what the PHP Team feels is good for a production server. There are a few changes you will need to make to configure PHP for your IIS 6 system:
- Uncomment and set the key, cgi.force_redirect = 0
- Uncomment the key, fastcgi.impersonate = 1
- Uncomment and set the key, extension_dir to the ‘ext’ folder in the path PHP was extracted to (i.e. ‘C:PHPext’).
- Set the key, date.timezone to the time zone of your server (the URL on the line above this key lists the accepted values).
At this point, your Windows system can run PHP scripts from the command line using the ‘php.exe’ tool.
Installing the IIS 6 FastCGI Extension
In order for Internet Information Services (IIS) 6 to execute and serve PHP scripts, some additional configuration is required. In this guide, we will install PHP on IIS using the FastCGI interface which provides a good balance of stability and performance. Since FastCGI is not included with IIS 6 be default, we need to download and install it.
Install Php Curl On Ubuntu
The FastCGI installer does not require any configuration, however once the FastCGI extension is installed we need to configure it to run PHP.
Open the file ‘C:WINDOWSsystem32inetsrvfcgiext.ini’ in Notepad and find the ‘Types’ section and enter the configuration information:
[Types]
php=PHP
[PHP]
ExePath=C:PHPphp-cgi.exe
InstanceMaxRequests=5000
EnvironmentVars=PHP_MAX_REQUESTS:5000
Revise these values as needed according to your environment, but it is important that all of settings have the correct values. Once you are finished, save this file.
Configuring IIS to Run PHP via FastCGI
With both PHP and FastCGI installed and configured, all that is left is to set up IIS 6. When you open the IIS Management Console, under the Web Service Extensions make sure the “FastCGI Handler” is set to allowed.
Next, go to the Properties settings for the Web Sites group.
On the “Home Directory” tab, click the “Configuration” button.
Add a mapping for files with the .php file extension with the executable set to the FastCGI extension DLL.
How To Install Php Curl
Once you have applied all the changes, restart IIS.
Testing PHP
At this point, your server is ready to go, but just to be sure we can confirm your PHP setup through IIS pretty easily. Create a text file in the directory ‘C:Inetpubwwwroot’ named ‘phpinfo.php’ which simply contains the line:
<?php phpinfo(); ?>
Finally, browse to the address: ‘http://localhost/phpinfo.php’ on your server and you should see the PHP information page. If the page loads successfully, PHP is now up and running on your machine.
Conclusion
Once you have PHP up and running on your Windows system, you can take advantage of the multitude of PHP based applications available as well as develop and deploy your own.
Links
How To Install Php Windows
Download PHP Windows Binaries (non thread safe)
READ NEXTPhp On Windows Server 2012
- › Six Common Smarthome Mistakes Beginners Make
- › What Can I Do with My Old iPhone?
- › Free Download: Microsoft’s PowerToys for Windows 10
- › How to Overclock Your Computer’s RAM
- › What’s New in Chrome 77, Arriving September 10