Page 1 of 1

enabling PHP/cURL on windows. Last resort

Posted: Sat Feb 20, 2010 7:39 am
by JJJJJJ
Hi there,

When I try to run a script that uses CURL (I am running Windows 7), I get the following error message:

Code: Select all

Fatal error: Call to undefined function:  curl_init() in C:\xampplite\htdocs\LIB_http.php on line 249
I have googled around to fix this problem and so have already tried the following without success:

1. Uncommenting the extension=php_curl.dll line in php.ini. Note: On one of the posts I read a guy saying that people might be making the mistake of changing the php.ini file at php/php.ini rather than at Apache/bin/php.ini. However, there is only one php.ini file on my computer and it at php/php.ini

2. I have checked that extension_dir is set to: "C:\xampplite\php\ext"

3. I have tried with register_globals set to On, but I would rather keep that set to Off anyway if poss.

4. I have checked that the php_curl.dll file exists in the php/ext directory and it does.

5. I have made copies of php_curl.dll, libeay32.dll and ssleay.dll and moved them to my Windows/system32 directory

6. I have restarted the server(localhost) several times and restarted my computer to see if that would make a difference, but it hasn't.

I just wonder if someone has any ideas?

Many thanks in advance

Joe

Re: enabling PHP/cURL on windows. Last resort

Posted: Sat Feb 20, 2010 8:21 am
by JJJJJJ
Further to my last post:

I get the error when using a command line to execute my script. I compile the php file to an exe file and then execute the exe file.

I have just tried to use my browser to test the script and it works! If I type in:

Code: Select all

http://localhost/Webbots/test3.php
then the script returns the contents of a webpage, so when I display the actual html on the browser by displaying it between

Code: Select all

<xmp></xmp>
tags it shows the full html just how I want it to look in the command line box (shell??).

I have no idea why the it should work with the browser but not from the command line. Any ideas?

Note: I am compiling my code to an exe only because when I type in:

Code: Select all

php test3.php
into the command line I get a message saying:

Code: Select all

'php' is not recognized as an internal or external command,
operable program or batch file.
Many thanks

Joe

Re: enabling PHP/cURL on windows. Last resort

Posted: Sat May 22, 2010 9:04 pm
by Eran
1. If you've compiled the PHP into an executable, then you need to compile all the extensions it needs with it. Once it is in executable form, it is no longer using the PHP binaries you have installed so it doesn't matter what you change in the php.ini.
2. If the php installation folder is not a included in your system's PATH variable, then you need to use the full path to the binary when trying to run it from the shell. The same as any other executable