TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-17-2009, 08:30 PM   #1 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default 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...
allworknoplay is offline  
Reply With Quote
Old 03-17-2009, 11:16 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 03-17-2009, 11:51 PM   #3 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
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?
allworknoplay is offline  
Reply With Quote
Old 03-18-2009, 09:55 AM   #4 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following User Says Thank You to Wildhoney For This Useful Post:
allworknoplay (03-18-2009)
Old 03-18-2009, 10:15 AM   #5 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

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)
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
allworknoplay (03-18-2009)
Old 03-18-2009, 11:42 AM   #6 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

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.
__________________
Tanax is offline  
Reply With Quote
Old 03-18-2009, 12:35 PM   #7 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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.
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Tanax (03-18-2009)
Old 03-18-2009, 01:13 PM   #8 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
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 View Post
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...
allworknoplay is offline  
Reply With Quote
Old 03-18-2009, 02:20 PM   #9 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
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.
__________________
Tanax is offline  
Reply With Quote
Old 03-18-2009, 09:52 PM   #10 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post

And sorry for hijacking your thread allworknoplay.
No problem. You should come to the LINUX side though...

allworknoplay is offline  
Reply With Quote
Old 03-18-2009, 11:21 PM   #11 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Yuck! No thanks xDD LINUX is.. bleeh!
I'm thinking however to buy a Mac next time
__________________
Tanax is offline  
Reply With Quote
Old 03-18-2009, 11:34 PM   #12 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
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...
allworknoplay is offline  
Reply With Quote
Old 03-19-2009, 07:33 AM   #13 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Indeed xD
But they're really good though, and I need one for my music studio
__________________
Tanax is offline  
Reply With Quote
Old 03-19-2009, 11:10 AM   #14 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
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.
xenon is offline  
Reply With Quote
Old 03-19-2009, 12:46 PM   #15 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Quote:
Originally Posted by xenon View Post
...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
__________________
Tanax is offline  
Reply With Quote
Old 03-19-2009, 03:31 PM   #16 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by xenon View Post
...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...
allworknoplay is offline  
Reply With Quote
Old 03-21-2009, 07:24 AM   #17 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
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.
xenon is offline  
Reply With Quote
Old 03-21-2009, 10:06 AM   #18 (permalink)
The Contributor
 
Join Date: Feb 2009
Posts: 65
Thanks: 0
Krik is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
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.
Krik is offline  
Reply With Quote
Old 03-21-2009, 08:24 PM   #19 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by xenon View Post
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...
allworknoplay is offline  
Reply With Quote
Old 03-21-2009, 08:27 PM   #20 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Krik View Post
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...
allworknoplay is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
yet another curl question.... Jenski General 8 07-01-2008 10:36 AM
Saving ALL the cookie data using cURL Wildhoney Advanced PHP Programming 1 06-12-2008 07:07 PM
A serious curl checkbox problem bedri Advanced PHP Programming 1 05-22-2008 04:25 PM
Need to get XML file using a curl alternative chimpo Absolute Beginners 1 05-12-2008 08:46 PM
Kidnapping files via URLs with cURL :) EyeDentify The Lounge 2 05-10-2008 09:03 AM


All times are GMT. The time now is 06:12 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design