开发者

how to enable curl in xampp

I am facing this error given below

Fatal error: Call to undefined function curl_init() in E:\xampp\htdocs\new\functions.php on line 11

I have already made change in php.ini. I have removed the semicolon in front of

;extension=php_crack.dl开发者_StackOverflow社区l
extension=php_curl.dll
;extension=php_cvsclient.dll

and after that restart the xampp but still facing same problem.Is there any other change need.Please let me know if any I shall be very thankful to you all


If you are using XAMPP, check these two locations:

  • C:\xampp\xampplite\apache\bin\php.ini
  • C:\xampp\xampplite\php\php.ini

For the line ;extension=php_curl.dll.

Remove the semicolon, save both files, restart your Apache and then run it again. I hope it will work.


In Xampp i've found php.ini at this location:

C:\xampp\php\php.ini

I've removed ";" from ";extension=php_curl.dll" line. It works fine.


Make sure you locate all the php.ini files in XAMPP. (Search your xampp folder for them). As far as I know, XAMPP has two or three, and it may be that you've enabled it in the incorrect file.


As you said, we'll uncomment the line ";extension=php_curl.dll" in php.ini

php.ini can be in multiple places. To check where the pertinent one is, go to phpmyadmin (http://localhost/phpmyadmin) run phpinfo() -> left hand side menu.

It'll say a half page down in the left column: "Configuration File (php.ini) Path" with the path in the right column.

Or just search the page for php.ini (Ctrl+F)

Different versions of xampp had php.ini if in different directories, and some have 3 versions of the file in different places. Many tutorials say to change all of them in case you change settings/uses later.

Open file in text editor and find the line (via search) ;extension=php_curl.dll

Remove the ";" to uncomment it, so it becomes: extension=php_curl.dll

Save file. Restart apache.

Double check and run phpinfo() again. Search for "curl" Under "cURL support" It should say "enabled."

Cheers!


Open php.ini and look for "extension_dir" parameter. Check that it is the correct and absolute path to your php extension dir.

Example of a correct extension directory on windows xampp:

extension_dir=c:\xampp\php\ext

If you are not sure what is happening try opening Apache error log and look for the text "php_curl" and "Unknown on line 0". This is the typical error message dispatched when Apache cannot load a module.


Run the phpinfo(); from xampp and check out curl is enabled or not. or get script from here to check curl is enabled.

http://www.webune.com/forums/how-to-check-curl-installed-in-php.html


Check this out: http://www.kanersan.com/blog.php?blogId=45 I had a similar problem except for error reporting. Searched all over the internet and all I found was "modify the php.ini file". I modified all the php.ini files but I was still getting the same error. Turns out WAMP has visual settings which I believe overwrite the php.ini. So to turn on curl, you'd left click on XAMPP icon in your start start menu -> PHP -> PHP Settings -> php_curl (make sure it is checked).

Maybe this is your problem.

Hope it helps.

-c0d3


if you have already uncommented line from php.ini and still getting error than you should make sure that this extension file is exists in php folder or not

so check for this file

php_curl.dll

in xampp\php\exts

if it's not there than download it from internet and paste it to there

Restart Apache.


Steps:

  1. Go to XAMPP folder: C:\xampp\php
  2. Find php.ini file
  3. Open it and remove semicolon before php_curl.dll, so, replace ;extension=php_curl.dll with extension=php_curl.dll
  4. Restart Apache before refreshing the page
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜