 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
03-17-2009, 08:30 PM
|
#1 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Cannot use CURL?
Hi,
I do have curl installed and I just can't get it to work. Here's my curl setup.
curl -V
curl 7.12.1 (i386-redhat-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6
Protocols: ftp gopher telnet dict ldap http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
Code:
<?php
define("CURL_PATH", "/usr/bin/curl");
$ch = curl_init('index.html');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "email_address=email&password=password");
curl_exec ($ch);
curl_close ($ch);
?>
I keep getting this error...
Fatal error: Call to undefined function: curl_init() in /usr/local/apache/test.html on line 5
Line 5 is this:
$ch = curl_init('index.html');
I tried both relative and absolute paths for the URL and it still doesn't work...
|
|
|
|
03-17-2009, 11:16 PM
|
#2 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Is it the cURL plugin enabled in php.ini?
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
03-17-2009, 11:51 PM
|
#3 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Wildhoney
Is it the cURL plugin enabled in php.ini?
|
Nothing in php.ini but I did figure it out.
Eventhough I had CURL installed, I didn't have libcurl installed.
So I downloaded libcurl and installed it.
Recompiled my PHP with it, restarted Apache and now it works.
What I don't get is, what is the difference between libcurl and curl?
Is libcurl just some kind of wrapper for curl? I always thought that CURL was a PHP specific set of libraries...is it available for other languages like ASP, Perl etc?
|
|
|
|
03-18-2009, 09:55 AM
|
#4 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
cURL, I think, is the PHP interfact to Libcurl. Libcurl is not just PHP orientated, it's used in many various instances.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|
|
The Following User Says Thank You to Wildhoney For This Useful Post:
|
|
03-18-2009, 10:15 AM
|
#5 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
cURL is the stand-alone wrapper for the libcurl libraries. libcurl is not specific to PHP, its a commandline tool (via the curl commandline wrapper) and php has bindings for it (as do many other langauges).
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|
|
The Following User Says Thank You to sketchMedia For This Useful Post:
|
|
03-18-2009, 11:42 AM
|
#6 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
I have a question regarding this topic, didn't feel like starting an own thread for it.
I'm using WAMP, how would I install cURL(and also SSL) on it? I can't compile the PHP in it, or can I? And how?
Anyways, I'm just wondering.
I'm using Windows if that is important to know. But you probably knew that since I was using WAMP and not MAMP.
__________________
|
|
|
|
03-18-2009, 12:35 PM
|
#7 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Tanax, go to your PHP Info page (probably http://127.0.0.1/?phpinfo=1 ) and note down the location of the php.ini being used (probably <wamp_path>/bin/apache/ <apache_ver>/bin/php.ini ).
Stop the apache service (clicking the systray icon has the option to stop all services). Edit the line which says ";extension=php_curl.dll" in the php.ini file -- remove the semicolon. Save it. Start the apache service.
In theory, that should work (go back to the PHP Info page to see if curl is loaded) but no guarantees. 
|
|
|
|
|
The Following User Says Thank You to Salathe For This Useful Post:
|
|
03-18-2009, 01:13 PM
|
#8 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Wildhoney
cURL, I think, is the PHP interfact to Libcurl. Libcurl is not just PHP orientated, it's used in many various instances.
|
Quote:
Originally Posted by sketchMedia
cURL is the stand-alone wrapper for the libcurl libraries. libcurl is not specific to PHP, its a commandline tool (via the curl commandline wrapper) and php has bindings for it (as do many other langauges).
|
Wow, I had it backwards! So CURL is the wrapper for libcurl, got it...
|
|
|
|
03-18-2009, 02:20 PM
|
#9 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Quote:
Originally Posted by Salathe
Tanax, go to your PHP Info page (probably http://127.0.0.1/?phpinfo=1 ) and note down the location of the php.ini being used (probably <wamp_path>/bin/apache/ <apache_ver>/bin/php.ini ).
Stop the apache service (clicking the systray icon has the option to stop all services). Edit the line which says ";extension=php_curl.dll" in the php.ini file -- remove the semicolon. Save it. Start the apache service.
In theory, that should work (go back to the PHP Info page to see if curl is loaded) but no guarantees. 
|
Thanks alot! It worked quite well 
Tho, I didn't find SSL there..
However:
Quote:
|
Originally Posted by phpinfo()
cURL support enabled
cURL Information libcurl/7.16.0 OpenSSL/0.9.8g zlib/1.2.3
|
OpenSSL = same thing as SSL(the thing you were talking about my error of context streams ??
Thanks alot!
And sorry for hijacking your thread allworknoplay.
__________________
|
|
|
|
03-18-2009, 09:52 PM
|
#10 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Tanax
And sorry for hijacking your thread allworknoplay.
|
No problem. You should come to the LINUX side though...

|
|
|
|
03-18-2009, 11:21 PM
|
#11 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Yuck! No thanks xDD LINUX is.. bleeh!
I'm thinking however to buy a Mac next time 
__________________
|
|
|
|
03-18-2009, 11:34 PM
|
#12 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Tanax
Yuck! No thanks xDD LINUX is.. bleeh!
I'm thinking however to buy a Mac next time 
|
Nothing wrong with MAC. I am thinking of getting one myself. The only problem is that they are so damn expensive...
|
|
|
|
03-19-2009, 11:10 AM
|
#13 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
Quote:
Originally Posted by Tanax
Yuck! No thanks xDD LINUX is.. bleeh!
I'm thinking however to buy a Mac next time 
|
...but you do know that Mac OS X is actually a UNIX based operating system, right? That means it's nothing different from any Linux distribution, except for the interface (and the fact that it's commercial).
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|
03-19-2009, 12:46 PM
|
#14 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Quote:
Originally Posted by xenon
...but you do know that Mac OS X is actually a UNIX based operating system, right? That means it's nothing different from any Linux distribution, except for the interface (and the fact that it's commercial).
|
Nope xDD
Well I hate LINUX's interface, that's what I mean.
And I love Mac's interface, it's great. A little difficult to understand in the beginning tho, but I'll get use to it 
__________________
|
|
|
|
03-21-2009, 10:06 AM
|
#15 (permalink)
|
|
The Contributor
Join Date: Feb 2009
Posts: 65
Thanks: 0
|
Quote:
Originally Posted by Tanax
Nope xDD
Well I hate LINUX's interface, that's what I mean.
|
Umm, that statement hints of error.
Yea command line isn't as nice as GUI (I must admit I miss my days of programing DOS 3.2, it was simpler). But for some reason I doubt you are referring the command line of Linux and are referring to one of over 1000 GUI's built for Linux (not counting custom built GUI's).
I have seen GUI's for Linux that could make you swear it was a Windows OS, same goes for the Mac OS. The only real hindrance is usually found in that the software you would want to use with Linux not being available or very difficult to configure.
I personally insist on Linux servers for my web design. Last I worked with a Linux machine, hands on, was almost 4 years ago when I was consulting on a backoffice server. I personally use Windows systems for all my PC's and would only get a Mac if I was doing CGI rendering. And even then I would set it up to run Windows within the Mac OS for when I wasn't doing CGI.
|
|
|
|
03-21-2009, 08:27 PM
|
#16 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Krik
Umm, that statement hints of error.
Yea command line isn't as nice as GUI (I must admit I miss my days of programing DOS 3.2, it was simpler). But for some reason I doubt you are referring the command line of Linux and are referring to one of over 1000 GUI's built for Linux (not counting custom built GUI's).
I have seen GUI's for Linux that could make you swear it was a Windows OS, same goes for the Mac OS. The only real hindrance is usually found in that the software you would want to use with Linux not being available or very difficult to configure.
I personally insist on Linux servers for my web design. Last I worked with a Linux machine, hands on, was almost 4 years ago when I was consulting on a backoffice server. I personally use Windows systems for all my PC's and would only get a Mac if I was doing CGI rendering. And even then I would set it up to run Windows within the Mac OS for when I wasn't doing CGI.
|
Linux is hands down the best for webdesign. I know I'm bias but it's ok. The LAMP structure is the best that's out there....
I would be interested in knowing what the current market share is between Apache and IIS.
I've always had a hell of bad time with IIS back in the days when I was coding in ASP.
I'd like to experience a Ubuntu or some form of linux that looks exactly like Windows or Mac...I would probably love using it for entertainment purposes...
The way I use linux now is pure command line...
|
|
|
|
03-19-2009, 03:31 PM
|
#17 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by xenon
...but you do know that Mac OS X is actually a UNIX based operating system, right? That means it's nothing different from any Linux distribution, except for the interface (and the fact that it's commercial).
|
That's the biggest key, "commercial" support.
It's what has kept Mac and Windows in the forefront for the longest time.
That has always been the issue with Linux. You have to be a certain type of individual to be a Ubuntu or some form of linux user...
Installation is getting easier and easier, but until commercial apps will support Linux, it will always be the 3rd wheel OS...from a consumer standpoint...
|
|
|
|
03-21-2009, 07:24 AM
|
#18 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
Quote:
Originally Posted by allworknoplay
Installation is getting easier and easier, but until commercial apps will support Linux, it will always be the 3rd wheel OS...from a consumer standpoint...
|
I couldn't agree more. But linux was never made so that an individual can easily install some applications from a GUI. It has its share of the market, and does its job extremely well (I mean the job it was intended to do - advanced server management). The UI is just a fancy tool for the stupid (no offense intended to anyone, I myself use Windows). And we all know that fancy stuff sells the best (take a look at Flash on the web market), although it's not always the best choice.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|
03-21-2009, 08:24 PM
|
#19 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by xenon
I couldn't agree more. But linux was never made so that an individual can easily install some applications from a GUI. It has its share of the market, and does its job extremely well (I mean the job it was intended to do - advanced server management). The UI is just a fancy tool for the stupid (no offense intended to anyone, I myself use Windows). And we all know that fancy stuff sells the best (take a look at Flash on the web market), although it's not always the best choice.
|
Right. I think it is Novell? That bought SuSe? And is trying to make it a standard corporate desktop OS, and seems to be failing miserably.
I remember this one company was being trained to use their OS and get rid of Windows but good luck on that....
The thing is, Windows isn't a bad OS! There are different types of users....
I use Windows for everything desktop related. I use Redhat/CentOS for all my heavy duty server related roles....
I want to get into Mac but haven't had the chance yet. I've also wanted to try Ubuntu but I haven't had time. I don't want to be watered down too much and try to know every OS that's out there...
Flash is very very visually impressive, I actually use Flash for my graphs but I want to get away from it and just use some type of GD or PNG/JPG type graphs, I just haven't found any that look BETTER than my Flash graphs...
|
|
|
|
03-19-2009, 07:33 AM
|
#20 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Indeed xD
But they're really good though, and I need one for my music studio 
__________________
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|