I have php_curl.dll in xampp/php/ext/ folder and in php.ini file I set extension=php_curl.dll (removed ';'). I also set extension_dir = "C:\xampp\php\extensions\" in php.ini file. Then I restarted the Apache, even I restarted the system 2 times. But till in Phpinfo() I cant see curl. and I am getting error like"Call to undefined function curl_init()"`
I have PHP version 5.2.4.
Check your Apache's error_log file. Even if php_curl.dll is activated in your php.ini, a startup problem might disable your php_curl.dll, so it doesn't show up in phpinfo(). Search for any line like this:
PHP Warning: PHP Startup: Unable to load dynamic library
Also check that the correct php.ini is loaded (is shown at the beginning of phpinfo()) and that your extension_dir is correctly configured.
"At http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ . Download the file that you need from the fixed curl extensions list at the bottom of the page, for example Windows 7 64 bit Machines will work correctly with the non nts file."
Source: http://www.developingtheweb.co.uk/php-5-4-3-and-5-3-13-curl-extension-fix/
Add
extension=php_curl.dll
in php.ini
Not every php_curl.dll is compatible with your system configuration. Make sure you are using a compatible version of the extension.
Yet, to make sure that you are editing the correct php.ini, you can read the phpinfo's output. It will tell you which php.ini file has been loaded. Make sure that you are modifying the same file.
You may need to use the entire path instead of the relative path.
Changing that line to this fixed it for me:
extension="C:\php\ext\php_curl.dll"
Related
I have enabled the cURL extention in he php.ini folder, I have copied mutliple dll files from the PHP folder into the Apache Bin folder and the System 32 folder but cURL is still not enabled on my system.
All the solutions that I have looked at:
How to enable cURL in PHP / XAMPP
http://php.net/manual/en/curl.installation.php
http://php.net/manual/en/curl.installation.php#115953
http://php.net/manual/en/curl.installation.php#117372
I know this because I still see the following error:
Fatal error: Call to undefined function curl_init() in C:\AMP\sites\ftp-crawl\index.php on line 55
When I run only phpinfo(), there are no cUrl options. The only mention of cURL is under module authors and its value is cURL: Sterling Hughes
I am running a windows 10 developer machine with PHP, MySQL and Apache installed.
What do I still need to do or check to enable curl?
I had the same problem. I fix it replacing the php_curl.dll. Maybe a file corruption.
In php.ini I setup with extension=php_curl.dll.
No more Call to undefined function curl_init() errors.
I resolved the issue by editing my PHP.ini to include the full path of the extension as opposed to just the name.
So where most php.ini files just have this line of code:
extension=php_curl.dll
I changed it to look like this:
extension=C:\amp\PHP\ext\php_curl.dll
I have no idea why PHP/Apache couldn't show an error while I had extension=php_curl.dll in my php.ini. At least saying something like dll missing or something like that, but that resolved my issue.
I believe you edited the demo or wrong php.ini file.
In your phpinfo you will find a path to the used php.ini file. It's next to the text: "Configuration File". Check out that file and make sure that the following option is set (by default it is commented out with a semicolon).
extension=php_curl.dll
If you can not find this line, you might have a different version of Apache. In this case you might find a directory called "mods-available" in which the curl extension lays. You need to move this file to the "mods-enabled" folder. Honestly I think this only applies to Linux environments, not sure about Windows.
It means that the curl module is not installed on the server. This problem generally occurs with php5. You need to check if php5-curl module is installed or not. Also confirm if curl is installed on the system.
Terminal command curl -v.
I know there's tons of topics about my problem, but I can't find a solution.
I'm using wamp and I've changed my version of PHP from 5.5.12 to 5.6.16, then when I go to localhost/phpmyadmin i have this error displayed :
Fatal error: Call to undefined function mb_detect_encoding() in
C:\wamp\apps\phpmyadmin4.1.14\libraries\php-gettext\gettext.inc on
line 177
So I update phpMyAdmin from 4.1.14 to 4.5.2.
And I have this **** error:
phpMyAdmin - Error The mbstring extension is missing. Please check
your PHP configuration.
My php.ini, phpForApache.ini is configured, I have un-commented the extension, set extension_dir to C:\wamp\bin\php\php5.6.16\ext, I stumbled on many topics/forum but none of the solution works.
Do you have any idea?
Please check #36254548
Copying the php.ini file to "wamp64\bin\apache\apache2.4.17\bin" has solved my problem.
Sometimes the extensions directory is well pointed to, the dll files have been uncommented but it still doesn't work.
The next solution to use, that is if your extensions directory is correct and dll files for the mbstring has been uncommented, then copy the php.ini file and paste it into the windows directory (i.e. C:\Windows).
You then restart your wamp/xampp and it will work.
check your php.ini file. In the extensions part of the configuration you should find:
;extension=php_mbstring.dll
remove the leading ';' to uncomment and enable the extension so it looks like this:
extension=php_mbstring.dll
restart your apache and it should work.
I faced the same issue when I start wamp, suddenly my project was not working and when I check the phpmyadmin, it gives the same above error.
My debugging process found php.ini file is missing. However I already installed two PHP versions, 5.6.19 and 7.0.4. I changed the version to 7.0.4 and then re-changed to 5.6.19. It started work.
What I guess, while changing the version, all the configuration files getting re-installed in wamp folder.
I am having below error when I try to implement google and facebook authentication in windows 7 using wamp server.
Fatal error: Call to undefined function curl_init() in
E:\wamp\www\mysite\protected\extensions\eauth\EAuthServiceBase.php
on line 273
I am using,
wampserver 2.2
php version 5.3.13
I have enabled php_curl module as well. I checked in php.ini for confirm and it is uncommented as below.
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
The code has worked in ubuntu with xampp, but not in wamp in windows. I have done everything I can find. I have tried replacing the php_curl.dll also according to the comment on this thread, Call to undefined function curl_init() - with WAMP
My phpinfo() looks like below.
I have installed wamp in the partition E:\, but the "Configuration File (php.ini) Path" seems different, it is C:\Windows.
Please help me to fix the issue.
Visit this and have a file under Fixed curl extensions:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
after download and replace related file then restart server.
In browser navigate to localhost and make sure there is curl extensions showing under Loaded Extensions :
For WAMP running PHP 5.4.3 on Windows 7 64 bit, make sure you use php_curl-5.4.3-VC9-x64.zip NOT php_curl-5.4.3-nts-VC9-x64.zip.
In windows 7 with PHP 5.5.31 after check that php_curl.dll extension is enabled (and still doesnt working), work for me to copy libeay32.dll and libssh2.dll from php directory to Apache bin.
just a guess - this section in php.ini does not reference the correct location
; Directory in which the loadable extensions (modules) reside.
extension_dir = *some value*
http://www.php.net/manual/en/ini.core.php#ini.extension-dir
edit
Also, look for this block in your phpinfo, if it's not there, curl isn't loading (obviously). You're not looking for matching version numbers - just for the block's existence.
edit
look at this question also
PHP and CURL under Windows 7 64 bits and Apache
When using WAMP..
You should have one file php.ini in the main PHP directory
In the php.ini enable the extension extension=php_curl.dll, by removing the ; char
The extension_dir must look like this example: extension_dir = "D:\AMP\PHP\ext\", so not a relative path
You need to restart Apache server only once. No need to restart it many times
Just make sure, you have the php_curl.dll in the ext directory
(windows 10 user)
Since this is the first result in Google and I had exactly the same problem and none of your solutions worked for me and I finally find the correct solution in an other thread of stackoverflow, I'll post link here :
EasyPHP Devserver 16.1 Curl Win 10
The solution is to add the your current PHP directory (depend of which version you use) to your global "path" variable in windows (like explained in the link, but you don't need to add all php directorias of course)
Not sure where to put my experience, hope it will be useful for someone.
In my case (win7 x64 + apache 2.4 + php 7.2), curl extension was enabled in php.ini but did not load. Resolved by replacing libs libssl-1_1-x64.dll and libcrypto-1_1-x64.dll in Apache's bin folder with the latest builds of OpenSSL
For those running PHP 7+ on windows, there is no php.ini file in the php directory by default.
You need to:
create a php.ini file in your PHP directory (it should be under C:\php\, or wherever your php directory is located)
Copy the content of either php.ini-development or php.ini-production into the php.ini file you've created.
Finally remove the semicolon (;) before extension=curl
Change the extention in php.ini file uncomment by removing ; like below
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
Then restart all services and it will work.
I spent three hours but I did not find anything; I'm unable to connect to a SSL enabled server. I want to list what i did:
First checked my PHP extensions directory was in order; extension wasn't there, php_openssl.dll
Then I opened my php.ini file but I could not see any extension=php_openssl.dll line to uncomment.
Also, I searched on Google and saw people with the same problem.
http://www.apachefriends.org/f/viewtopic.php?p=162623
However, I also have
OPENSSL_CONF C:/xampp/apache/bin/openssl.cnf
...
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 0.9.8l 5 Nov 2009
OpenSSL Header Version OpenSSL 0.9.8l 5 Nov 2009
no lines . What should I do? Please share your suggestions.
Yes, you must open php.ini and remove the semicolon to:
;extension=php_openssl.dll
If you don't have that line, check that you have the file (In my PC is on D:\xampp\php\ext) and add this to php.ini in the "Dynamic Extensions" section:
extension=php_openssl.dll
[PHP_OPENSSL]
extension=php_openssl.dll
This is the answer.
Things have changed for PHP > 7. This is what i had to do for PHP 7.2.
Step: 1: Uncomment extension=openssl
Step: 2: Uncomment extension_dir = "ext"
Step: 3: Restart xampp.
Done.
Explanation: ( From php.ini )
If you wish to have an extension loaded automatically, use the following syntax:
extension=modulename
Note : The syntax used in previous PHP versions (extension=<ext>.so and extension='php_<ext>.dll) is supported for legacy reasons and may be deprecated in a future PHP major version. So, when it is possible, please move to the new (extension=<ext>) syntax.
Special Note: Be sure to appropriately set the extension_dir directive.
So, what did we do to make openssl_pkey_new() and all the other openssl_ functions in PHP work...
Enabled the extension php_openssl.dll in the (right/active) php.ini. Checked.
Checked that there exists a openssl.cnf in xampp\apache\conf\ (and also in two other directories within XAMPP). Checked.
Added the environment variable OPENSSL_CONF in the Windows system settings with the full path to the above openssl.cnf. Checked.
Restarted Apache (and after that did not work restarted the computer several times...). Checked.
Still does not work, and throwing errors such as
error:0E06D06C:configuration file routines:NCONF_get_string:no value
error:02001002:system library:fopen:No such file or directory
error:2006D080:BIO routines:BIO_new_file:no such file
Okay, here are another two more things to check.
1. Trouble with the environment
Run phpinfo() from a PHP script, and go to the "Apache Environment" section. Check the value of OPENSSL_CONF.
Surprise. This is not what we have set in the windows system settings.
The solution is simple. Set the environment variable in the PHP script.
putenv('OPENSSL_CONF=C:\xampp\apache\conf\openssl.cnf');
2. Trouble with relative filenames
Now, openssl_pkey_new() will work, but openssl_pkey_export_to_file() does still not work and returns false without any further explanation?
Check the filename that you have specified as output filename. It will not work in Windows as long as you do not specify the full path.
$folder = realpath('../keyring');
$outfile = $folder.'/private.pem';
openssl_pkey_export_to_file($key, $outfile);
I use xampp. Beforehand I tried the example file "test_smtp_gmail_basic.php" in phpMailer (you can download phpMailer here: https://github.com/Synchro/PHPMailer), but I got the following error:
Mailer Error: The following From address failed: xxx#gmail.com
After I commented out ; extension=php_openssl.dll in php.ini, it is working now.
In xampp, if "extension=php_openssl.dll" is not present in your php.ini file then add it in the "Windows Extensions" section of your php.ini file
and restart your apache.
It works for me..
You will need to edit your php.ini. It's 4 easy steps.
Find your php.ini file.
$inipath = php_ini_loaded_file();
Enable openssl in the file:
extension=php_openssl.dll
Turn allow_url_fopen on
allow_url_fopen = On
Restart apache and you are done!
STEP 1: On your php.ini comment out ;extension=php_openssl.dll
STEP 2: Copy libeay32.dll and ssleay32.dll from your PHP root folder and paste it your Apache/bin folder
STEP 3: Restart Apache
I am assuming that this question is for those using a windows based system.
After making sure that the extension extension=php_openssl.dll in your php.ini file does not have a semicolon.
Then make sure that you have added C:/xampp/apache/bin into your environment path in order to use openssl without having move the command prompt to that directory C:/xampp/apache/bin
Although not related to this question but as the WP migrate Pro docs link to this question I though I would post an answer here.
If your having problems with DB Migrate Pro activating instead of enabling SSL you can just add a line of code to your wp-config
define( 'WPMDB_LICENCE', 'XXXXXXXXXXx' );
I've been working with a WAMP install for quite a while now with LDAP enabled and everything is going smoothly. Now though I have to set up another machine and for some reason I can't enable LDAP.
I checked the output of phpinfo() and the LDAP section isn't there. I edited php.ini to uncomment the line:
extension = php_ldap.dll
I also checked the filepath being searched for extensions and the file php_ldap.dll is in the right place.
I'm positive I'm editing the right php.ini file since I checked the filepath being shown by phpinfo(), and also I am able to successfully enable/disable other extensions.
I have rebooted Apache after every change made.
While Googling this, the only solutions I found were those above, plus one or two mentions of editing the Windows PATH variable to include the path to php.ini? Tried it even though it didn't make sense to me (as I already know php.ini is being parsed). I also checked my previous install on the other machine and from what I can see I never added any PHP directories to the PATH on that machine
Edit with complete answer
Frank's answer below led me to the solution so I thought I'd consolidate everything now.
To Enable LDAP Support on a WAMP server:
Uncomment extension = php_ldap.dll in php.ini
IMPORTANT: Make sure that you're editing the right php.ini by checking the output of phpinfo()
Check the php.ini file for the location of your extensions directory
Check that php_ldap.dll is located in that directory
(THE STEP I MISSED) Find the files libeay32.dll and ssleay32.dll and add their directory to the Windows PATH
Reboot Apache. If LDAP is enabled there will be a section about it in the output of phpinfo()
There are a few hints here: http://php.net/manual/en/ldap.installation.php . Note you need to add two other DLLs libeay32.dll and ssleay32.dll. You may also need to compile with --with-ldap
I followed these instructions but still couldn't get LDAP loading in my phpinfo(). The Apache logs showed on startup the following non-fatal message: ######/php5.4.16/ext/php_ldap.dll - The specified module could not be found. in Unknown on line 0
In the end, I looked at phpinfo() again and saw that the system variable PATH was being used instead of my user variable PATH and it didn't contain the correct path to PHP's root and PHP's extension folder. Simply adding them in ####\php\php5.4.16;####\php\php5.4.16\ext; and restarting Apache, solved the problem. Hope this can help someone else out.
Check out libsasl.dll libeay32.dll, ssleay32.dll in your PHP folder
If libeay32.dll, ssleay32.dll are not there, download it from https://code.google.com/archive/p/openssl-for-windows/downloads
Copy them to System32 folder in Windows
Now you can see LDAP section on you phpinfo(). it worked for me.
My environment
Windows 10
PHP 7.4.3
Apache 2.4.41
im using phpstorm. if you cant find the comment, just paste"extension = php_ldap.dll" at the bottom of your php.ini page. you are welcome