I am not familiar at all with setting up an Apache/PHP web server, but I have to do this since my IT staff won't. I've looked at everything I can find online, and I just can't get cURL to load in PHP on windows apache. I installed Apache 2.2, it works. I installed PHP, and that works, which I know because my php script checks to ensure the cURL extension is loaded, and my php echo is returned to the browser, my code for that is shown below:
if (!extension_loaded("curl")) {
header('Status: 500', true, 500);
echo 'cURL extension for PHP is not loaded! <br/> Add the following lines to your php.ini file: <br/> extension_dir = "<your-php-install-location>/ext" <br/> extension = php_curl.dll';
return;
}
I've done the following:
- I've uncommented
extension_dir="c:\php\ext\"(and tried numerous variations of that path, using forward and backward slashes, etc., as well as the./ext/approach). - I've ensured I have
extension=php_curl.dllin myphp.ini. - I've made sure that my apache user has read and execute permissions on the PHP folder and all subfolders/files
- I've made sure I have
C:\PHPin my path environment variable. - I've tried the suggestions here: Could not load php_curl, and here: PHP cURL is not loaded on modifying php.ini, as well as many others outside of StackOverflow.
Nothing has worked. I'm running on a Windows Server 2003 box. I get no error message in the Apache log. I'm stuck. Please help! Thanks.
Adding requested Apache log info:
[Tue Aug 14 14:38:22 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Aug 14 14:38:23 2012] [notice] Apache/2.2.22 (Win32) PHP/5.2.17 mod_ssl/2.2.22 OpenSSL/0.9.8t configured -- resuming normal operations
[Tue Aug 14 14:38:23 2012] [notice] Server built: Jan 28 2012 11:16:39
[Tue Aug 14 14:38:23 2012] [notice] Parent: Created child process 5616
[Tue Aug 14 14:38:24 2012] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Aug 14 14:38:25 2012] [notice] Child 5616: Child process is running
[Tue Aug 14 14:38:25 2012] [notice] Child 5616: Acquired the start mutex.
[Tue Aug 14 14:38:25 2012] [notice] Child 5616: Starting 64 worker threads.
[Tue Aug 14 14:38:25 2012] [notice] Child 5616: Starting thread to listen on port 8080.
function_exists('curl_init')also return false? I'm wondering if it isextension_loaded()that is broken. Also, remember that the php.ini configuration used by the Apache mod_php SAPI is only loaded when Apache is started (not every request) so you need to restart the Apache service after you modify php.ini. If an extension is unloadable based on the php.ini settings, you will usually see errors logged in the Apache error log at startup with a helpful(ish) error message.