5

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.dll
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

3
  • Did you do a phpinfo? That change, if done in the right ini file is enough. Commented Mar 24, 2011 at 11:22
  • Run a phpinfo(); in a separate page and tell us if you can locate a "curl" paragraph. If you don't find it, you have a php configuration issue. Commented Mar 24, 2011 at 11:24
  • I have run phpinfo(); but not able to find out Commented Mar 24, 2011 at 11:26

9 Answers 9

10

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.

Sign up to request clarification or add additional context in comments.

Comments

4

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.

Comments

1

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.

7 Comments

location of php.ini where i have made change E:\xampp\apache\bin\php.ini
@shalu: Look for the PHP ini file here as well E:\xampp\php\php.ini
I also made the change in this file E:\xampp\php\php.ini
and also made the change in E:\xampp\php\php4
@shalu: Make sure you Stop and then Start your Apache service from the XAMPP control panel.
|
1

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!

Comments

1

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.

Comments

0

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

Comments

0

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

Comments

0

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.

Comments

-1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.