I recently upgraded my development environment to PHP 5.5.18 with Apache 2.4. Everything seemed to be working fine.
But when I tried to upgrade my bleeding edge WordPress environment to WordPress 4.1-beta2 it failed with.
Download failed.: There are no HTTP transports available which can complete the requested request.
I spent some time analysing the problem and found it to be that I hadn’t enabled CURL. But when I did enable CURL, it still didn’t work.
Looking at the number of reports in Stack Overflow this seems to have been a fairly common problem, with a variety of workarounds, many of which don’t actually address the basic issue. Here’s my solution.
- Apache is configured to start as a service
- The CURL extension is enabled in php.ini
- You have stopped and restarted Apache
- But CURL is not working
- Ensure that your system
PATHenvironment variable contains the directory in which PHP is installed.
- Stop the Apache server and restart it once more. With luck CURL will start working.
Assume PHP is installed in c:\php
- When Windows is starting the Apache service the
PATHenvironment variable is set to the system version.
- Windows uses the path to discover the DLLs that are needed by the program.
- The CURL extension ( php_curl.dll, located in c:\php\ext ) is dependent upon a number of DLLs including: libeay32.dll, ssleay32.dll and (since 5.5.17) libssh2.dll
- The PHP provided DLLs are located in c:\php
- If Apache cannot load the DLL due to dependencies not being satisfied then it does so silently.
Therefore, if you’ve attempted to configure your
php.ini to load the php curl extension but not included
c:\php in your path environment variable then the php_curl.dll won’t get loaded and CURL functions won’t work; since they won’t actually exist.
Fatal error: Call to undefined function curl_init()