Asked  7 Months ago    Answers:  5   Viewed   36 times

Follow-up from my post yesterday (Enabling cURL with PHP)

The problem is that PHP isn't able to load php_curl.dll. I've tried several steps including uncommenting extension=php_curl.dll, making sure the dependencies libeay32.dll and ssleay32.dll eixst in the path, re-downloading php_curl.dll, replacing the old one, and lastly copying the file into my System32 folder.

I'm using Apache 2.2 and PHP 5.4.14. I installed both using their individual packages; I'm not using XAMP or WAMP. I'm using Windows 7 64-bit.

Any help at all would be appreciated.

 Answers

34

libeay32.dll and ssleay32.dll have to be path-accessible for php_curl.dll loading to succeed.

But copying them into Apache's ServerRoot, Apache's bin, Window's System32, or even worse into the Windows main directory is a bad hack and may not even work with newer PHP versions.

The right way to do it is to add the PHP path to the Windows Path variable.

  1. In Control Panel -> System click on Advanced System Settings or press WIN+R and type SystemPropertiesAdvanced
  2. Click the button Environment Variables.
  3. Under System Variables you will find the Path variable. Edit it and prepend C:PHP; to it - or whatever the path to your PHP folder is.
    (Hint: If your PHP folder contains spaces like C:Program FilesPHP you may need to use the short filename form here, i.e. C:Progra~1PHP.)
  4. Then fully stop Apache and start it again (a simple restart might not be enough).

Update 2017-05:
I changed the instructions above to prepend the Path variable with the PHP path instead of appending to it. This makes sure that the DLLs in the PHP path are used and not any other (outdated) versions in other paths of the system.

Update 2018-04:
If you have already chosen the wrong way and copied any of the PHP DLLs to Apache or Windows paths, then I strongly recommend that you remove them again! If you don't, you might get into trouble when you later try to update PHP. If a new PHP version brings new versions of these DLLs, but your old DLLs still linger around in system or webserver paths, these old DLLs might be found first. This will most certainly prevent the PHP interpreter from starting. Such errors can be very hard to understand and resolve. So better clean up now and remove any of the mentioned DLLs from Windows and Apache paths, if you copied them there.
(Thanks to @EdmundTam and @WasimA. for pointing out this problem in the comments!)

Update 2019-10:
Tip: To find all copies of these DLLs and check whether you might have placed them in the wrong folders, you can use the following commands in a Windows Command Prompt window:

dir c:libeay32.dll /s
dir c:ssleay32.dll /s

Be warned that these commands may take some time to complete as they search through the entire directory structure of your system drive C:.

Update 2020-08:
If your PHP folder contains spaces (i.e. C:Program FilesPHP) you may need to use the short filename form in the Path variable at step 3 (i.e. C:Progra~1PHP). Thanks to @onee for this tip!

Wednesday, March 31, 2021
 
zhartaunik
answered 7 Months ago
90

The ..._oci.dll is part of the Oracle C Interface. Unless you need to use Oracle, I suggest you go to the relevant line inside the php.ini file and uncomment the loading of this extension. However, if you need to use this extension, you’ll need to install the free Oracle Client libraries and add them to the path.

Oracle has a page where you can download the libraries needed for your setup work as expected and you can see here: Oracle Instant Client Downloads

Note: After you choose your operational system (Windows as in your answer) in download section you will see the installation guide in foot notes of the next page. For others OSs this process will work the same way.

Wednesday, March 31, 2021
 
Webroots
answered 7 Months ago
88

You should only call curl_close() when you know you're done with that particular handle, or if switching from its current state to a new one (ie: changing a ton of options via curl_setopt() would be faster by going from a clean new handle than your current "dirty" one.

The cookiejar/file options are only strictly necessary for maintaining cookies between seperate curl handles/invokations. Each one's independent of the others, so the cookie files are the only way to share between them.

Wednesday, March 31, 2021
 
huhushow
answered 7 Months ago
23

You need to add the Curl libraries to the command line PHP.ini.

You can probably just copy the file C:wampbinapacheApache2.2.xbinphp.ini to c:wampbinphpphp5.3.10php.ini (adjust for the actual directories on your system).

Wednesday, March 31, 2021
 
Fanda
answered 7 Months ago
27

I solved this problem using the 1.1.9 version of mongodb driver for php 5. First uninstall the current version of mongodb and then install the 1.1.9 version:

sudo pecl uninstall mongodb
sudo pecl install mongodb-1.1.9
composer update
Tuesday, August 10, 2021
 
KingCrunch
answered 3 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :