Curl not enable wamp [duplicate] - php

I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying
to get cURL working, so in my php.ini file, I have this line:
extension_dir ="F:\PHP\ext"
And later, I have:
extension=php_curl.dll
The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP
script, I get this in the error log:
PHP Warning: PHP Startup: Unable to load dynamic library 'F:\PHP\ext
\php_curl.dll' - The specified module could not be found.
in Unknown on line 0

Problem solved!
Although the error message said The specified module could not be found, this is a little misleading -- it's not that it couldn't find php_curl.dll, but rather it couldn't find a module that php_curl.dll required. The 2 DLLs it requires are libeay32.dll and SSLeay32.dll.
So, you have to put those 2 DLLs somewhere in your PATH (e.g., C:\Windows\system32). That's all there is to it.
However, even that did not work for me initially. So I downloaded the Windows zip of the latest version of PHP, which includes all the necessary DLLs. I didn't reinstall PHP, I just copied all of the DLLs in the "ext" folder to my PHP extensions folder (as specified in the extension_dir variable in php.ini), and I copied the versions of libeay32.dll and SSLeay32.dll from the PHP download into my System32 directory.
I also did an iisreset, but I don't know if that was necessary.

libeay32.dll and ssleay32.dll have to be path-accessible for php_curl.dll to work correctly.
In Control Panel -> Search -> Advanced System Settings and use the button Environment Variables.
Under System Variables find Path add the c:/php folder (or whatever path) and restart Apache.

A tip is to use the WAMP-installer. Everything just works. It's not IIS though - so if it is important - you should ignore my advice. ;)
EDIT: I saw that you found the solution so I voted it up. +1

I keep having same problem although i did the suggestion above and many others suggested on the internet i get
Sorry, but this plugin requires libcurl to be activated on your
server.
When i try to activate my plugin.
Edited: I was using php 5.3.13 had win64 windows 7 and none of the soln was working for me.
1.I had tried to copy the libeay32.dll SSLeay32.dll in windows\system32 folder did not work
2. Edited and uncommented both php.ini files did not work
3. Activated php_curl in php extensions did not work
4. Copied and replaced several times the www.anindya.com version of php_curl.dll but seems i was downloading the wrong version of this. The version that worked for me was in Fixed curl extensions section the second file php_curl-5.3.13-VC9-x64
Hope this will help anyone else

Faced this problem when I upgraded the php in UwAmp to 7.2.*. The only solution that worked for me was to download the latest version of apache at the time (Apache/2.4.37 (Win32)) and replace the one that came with UwAmp. That also involved editing the sample httpd.conf to produce an httpd_uwamp.conf file. UwAmp needs this template to then generate the actual httpd.conf when it starts up. All other suggestions above didn't resolve it for me unfortunately. Also note that as of OpenSSL 1.1, libeay32.dll and ssleay32.dll are no longer required (see http://php.net/manual/en/curl.installation.php)

In your case just add "F:\PHP\ext" to Environment Variable "path".

Related

Enabling CURL with PHP 5.6 on Windows 8

I have Apache 2.4.12 and php 5.6.9 on my Windows 8 computer and I'm trying to enable the curl extension for php however, I haven't had much success. After searching the internet for this issue it appears that other's have had the same trouble. Here are the suggestions I've found:
Uncomment ;extension=php_curl.dll in php.ini
Uncomment ;extension_dir = "ext" in php.ini
Download and replace the php_curl.dll file in the ext directory of php with one from this website
Add to the PATH environment variable where php is installed
Copy libeay32.dll and ssleay32.dll from where php is installed to C:\Windows\System32
I've tried every single suggestion with no success except the third item in the list because it doesn't have a .dll file for curl with php 5.6, in fact the highest version avaible is one for php 5.4. There has to be way to enable this extension without having to downgrade my php version to 5.4 and using a .dll file from that website. I've tried searching the internet for a .dll file like the one on the linked website for php 5.6 opposed to a version of php that's outdated but I've had no luck in finding one so I'd like help with this issue.
How can I enable curl for php 5.6 on my Windows 8 machine?
Locate your php folder and follow these instructions:
Move to Windows\system32 folder:
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll
Move to Apache24\bin folder
libssh2.dll
Uncomment extension=php_curl.dll
Note: Don't overwrite when prompted.
Source
I give you an example of a set up that just worked perfectly for me :
downloaded the VC11 x86 Thread Safe version of PHP,
unzipped it within a directory C:\php,
edited the php.ini-development, uncommenting 2 lines :
extension=php_curl.dll
extension_dir = "ext"
saved this file under php.ini.
I just tested it via the CLI (windows CMD here) on a PHP a file (i.e. C:\php\php myFile.php) and cURL worked.
If you have Apache installed and prefer to test it in a browser, you obviously have to adapt this installation with your own files structure and to do not forget to restart Apache.
Running apache service with a specific user other than local system solved the problem for me. You can test this easily by stopping the apache service and running manually <apache dir>\bin\httpd.exe.
I fixed this problem by adding C:\php and C:\php\ext to PATH system variables.
Press window + pause to bring up the System Properties page.
Click Advanced System Settings
Click Environment Variables
You'll see the Path variable in the System Variables box in the bottom.
Append your PHP path to that variable. Now the system will be able to load the extensions.
In addition to uncommenting the line
;extension_dir = "ext"
Try also setting it to the absolute path of the PHP installation's ext folder and then restarting apache.
e.g.:
extension_dir = "C:\PHP 5.6.19\ext"

PHP Startup Unable to load dynamic library php_mongo.dll

I'm a beginner for this. I'm trying to install mongodb driver on php.
Platform: Windows 8.1 64bit.
PHP 5.5.9
Apache/2.4.7
Followed the instruction here:http://php.net/manual/en/mongo.installation.php#mongo.installation.windows
I've tried all php_mongo.dll file with VC11 and put in php/ext folder. and added extension=php_mongo.dll in php.ini file but when I tried to start apache in xampp controller I got an error.
Php Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_mongo.dll' -%1 is not a valid Win32 application.
I've already check my VC compilator version inside phpinfo() and it's stated there MSVC11 with architecture: x86.
it would be nice if someone can help me.
Thanks. appreciate it.
Make sure you download the correct .DLL for your PHP installation. Good chance you're running apache x86, so download an x86 php_mongo.dll. Also if you're running PHP as an Apache module, make sure you pick the thread safe (ts) one and also pick this type of dll that matches the PHP version you're running.
The versions must match or else you will get a php startup error. Find these Mongo DLLs here.
I did this then I got an error libsasl.dll not found. I simply copied the libsasl.dll found in my PHP installation directory to the Apache installation directory (where httpd.exe is found). Then I restarted my Apache and it worked!
For anyone googling this in 2017, the PECL Package has been updated and is now found at http://pecl.php.net/package/mongodb/1.2.9/windows
and use:
extension=php_mongodb.dll
instead of:
extension=php_mongo.dll
Copy C:\xampp\php\libsasl.dll to C:\xampp\apache\bin\, restart Apache and enjoy.
If you are still having problems after doing the above, do try older version drivers instead.
That is what worked for me on for my XAMPP/ PHP 5.5 on windows 8.
Older drivers can be found here: https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
New drivers can be found here: http://pecl.php.net/package/mongo/1.5.5/windows
You may also want to visit : https://serverfault.com/questions/563867/mongodb-unable-to-load-driver-on-php
This is normally because we use 64 Bit supported DLL file 64 Bit system. But the wamp/xampp architecture could be 32 Bit. We need to use based on the wamp/xampp architecture not the windows architecture. So, try to find relevant version of DLL file to the wamp/xampp architecture. The solution in the below link worked like a charm to me,
http://grokbase.com/t/gg/mongodb-user/151xpk3fkr/php-5-6-3-with-mongodb-driver-unable-to-load-dynamic-library-not-a-valid-win32-application
This link helps you to find the wamp/xampp architecture, https://stackoverflow.com/a/22454865/4874281
After doing all the steps as mentioned in previous comments xampp may not be able to load the ".dll" file. Just ensure to add the path of the ".dll" file's folder to the environment variable as a system variable path.
I was facing same issue, then after adding the path of the ".dll" file's folder to the environment variable as a system variable path, it worked. It is then able to find the file.
At the end that was the only step which was stopping xampp to load the ".dll" file, although it was present in that folder. Often people miss this step as it is no where pointed out clearly.
My PHP version is 7.2.3 x86
Go to this website and pick DLL according to php version:
https://pecl.php.net/package/mongodb/1.4.2/windows
And set this in php.ini
extension=mongodb

Wampserver Orange - PHP_curl.dll

My Wampserver is orange and won't change.
When I go onto the Apache error log i get
PHP Warning: 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-linesxstrace.exe tool for more detail.\r\n in Unknown on line 0
I understand that this is a fairly common problem relating to the php_curl.dll. However I have tried many solutions and none work. I have tried both php 5.4.3 dll fixes(anindya's blog) and replaced the dll file in \wamp\bin\php\php5.4.3\ext. Curl is ticked and active in the php.ini file. extension_dir = "c:/wamp/bin/php/php5.4.3/ext/" ( Where the curl is located)
php_curl.dll libeay32.dll ssleay32.dll have been copied from c:/wamp/bin/php/php5.3.13/ext/ into C:\Windows\system32.
Is there anything else that could be causing this error I am merely trying to install Zend and its just been so complicated trying to get it to work.
I am running Wamp 2.2 on windows 7 64 bit. I have restarted WAMP after making changes.
1st. You close WAMP if you are using.
2nd. You'll %WAMP% / bin / php / (tuversion)
3rd. Edit php.ini -> Find the word curl, uncomment remove the semicolon) extension = php_curl.dll and guards
4th. Now you %WAMP% /bin/apache/(your_version)/bin
5th. You edit the php.ini -> Find the word curl, same uncomment (remove the semicolon) extension = php_curl.dll and guards
6th. Lift the WAMP again and ready.
Should work this..
The 64bit version of WAMP distributed with unusable curl extension.
Get one here instead (scroll down near end of post, titled Fixed curl extensions):
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
I am using WAMP for my 64 bit machine and faced this issue.
I tried the above specified solutions but still was facing the same error. The problem I found was with the php_curl.dll file inside my php/php-version/ext folder.
I replaced it with another php_curl.dll file downloaded from here
https://www.filesanywhere.com/fs/v.aspx?v=8a726a8a596273b7a6af
Replacing the original file with this file solved my issue and curl_init() function started working fine.
Before copying, stop your wamp server and then restart it again.
I hope this helps.

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.

PHP / cURL on Windows install: "The specified module could not be found."

I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying
to get cURL working, so in my php.ini file, I have this line:
extension_dir ="F:\PHP\ext"
And later, I have:
extension=php_curl.dll
The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP
script, I get this in the error log:
PHP Warning: PHP Startup: Unable to load dynamic library 'F:\PHP\ext
\php_curl.dll' - The specified module could not be found.
in Unknown on line 0
Problem solved!
Although the error message said The specified module could not be found, this is a little misleading -- it's not that it couldn't find php_curl.dll, but rather it couldn't find a module that php_curl.dll required. The 2 DLLs it requires are libeay32.dll and SSLeay32.dll.
So, you have to put those 2 DLLs somewhere in your PATH (e.g., C:\Windows\system32). That's all there is to it.
However, even that did not work for me initially. So I downloaded the Windows zip of the latest version of PHP, which includes all the necessary DLLs. I didn't reinstall PHP, I just copied all of the DLLs in the "ext" folder to my PHP extensions folder (as specified in the extension_dir variable in php.ini), and I copied the versions of libeay32.dll and SSLeay32.dll from the PHP download into my System32 directory.
I also did an iisreset, but I don't know if that was necessary.
libeay32.dll and ssleay32.dll have to be path-accessible for php_curl.dll to work correctly.
In Control Panel -> Search -> Advanced System Settings and use the button Environment Variables.
Under System Variables find Path add the c:/php folder (or whatever path) and restart Apache.
A tip is to use the WAMP-installer. Everything just works. It's not IIS though - so if it is important - you should ignore my advice. ;)
EDIT: I saw that you found the solution so I voted it up. +1
I keep having same problem although i did the suggestion above and many others suggested on the internet i get
Sorry, but this plugin requires libcurl to be activated on your
server.
When i try to activate my plugin.
Edited: I was using php 5.3.13 had win64 windows 7 and none of the soln was working for me.
1.I had tried to copy the libeay32.dll SSLeay32.dll in windows\system32 folder did not work
2. Edited and uncommented both php.ini files did not work
3. Activated php_curl in php extensions did not work
4. Copied and replaced several times the www.anindya.com version of php_curl.dll but seems i was downloading the wrong version of this. The version that worked for me was in Fixed curl extensions section the second file php_curl-5.3.13-VC9-x64
Hope this will help anyone else
Faced this problem when I upgraded the php in UwAmp to 7.2.*. The only solution that worked for me was to download the latest version of apache at the time (Apache/2.4.37 (Win32)) and replace the one that came with UwAmp. That also involved editing the sample httpd.conf to produce an httpd_uwamp.conf file. UwAmp needs this template to then generate the actual httpd.conf when it starts up. All other suggestions above didn't resolve it for me unfortunately. Also note that as of OpenSSL 1.1, libeay32.dll and ssleay32.dll are no longer required (see http://php.net/manual/en/curl.installation.php)
In your case just add "F:\PHP\ext" to Environment Variable "path".

Categories