473,386 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Enabling cURL in PHP

gchq
96
I'm attempting to enable cURL on a W2K server that runs PHP. Please bear in mind that I'm a .NET developer so a complete and utter newbie when it comes to PHP!!

It's been some eight to ten years since I originally installed PHP and can't remember how I went about it - updgrades have been performed by just replaced the old exe and dll with later ones! Basically it's run quite happily without any interference from me! Current version is 4.4.7

So far I've

1. Dowloaded the latest version of libcurl
2. Copied php_curl.dll to the PHP/Extensions directory
3. Found copies of libeay.dll and ssleay.dll in phpED and placed them in the PHP directory
4. Added the follwing lines to php.ini
extension_dir = C:\php\extensions
extension=php_curl.dll


I've come across "To use PHP's cURL support you must also compile PHP --with-curl[=DIR]" but - and this must sound idiotic - I have no idea what steps to take to compile the PHP OS!! I've googled and searched the PHP site but all references to compiling assumes that the reader knows what basic tools to use...

Any help would be very much appreciated
Sep 7 '07 #1
16 7197
Atli
5,058 Expert 4TB
Hi.

Check out the cUrl section at php.net.

This is a small extract from that page
Note to Win32 Users: In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH.

You don't need libcurl.dll from the cURL site.
Sep 7 '07 #2
gchq
96
Hi Atli

That's where I found "...you must also compile PHP --with-curl[=DIR]" - and that's the point at which I hit the proverbial brick wall - thud!
Sep 7 '07 #3
Atli
5,058 Expert 4TB
O yea, it was just above where I took my extract :P

Did you add the .ddl's to the PATH variable?
As far as I can see adding the php_licurl.dll as an extension and adding the other two to the PATH, should do the trick.

Then again, I might be horribly wrong... I'll snoop around a bit and see what I can turn up.
Sep 8 '07 #4
Atli
5,058 Expert 4TB
Ok. So I just installed Apache2 (2.2.4) and PHP5 (5.2.4) on my WindowsXP to check this out.
I just used the Install wizards, as that takes about 2 minutes and doesn't require me to go anywhere near a config file :)

The wizard installed cUrl for me, But! It wouldn't start. So after checking this out I found out exactly what the Installer did.

It put a copy of 'php_curl.dll' into the \ext directory of my PHP install directory.
Then it added it to my php.ini file.
It also put the 'ssleay32.dll' and the 'libeay32.dll' files directly into the PHP install directory.
So... thats all the files it needs, apparently.

Only problem was, it needs the last two .dll's to be accessible through the PATH variable. So I added it to.

After restarting Apache... still nothing.
So I did what one usually does when Windows won't play nice... I rebooted.

Now everything clicked into place and curl is up and running!
Sep 8 '07 #5
gchq
96
Atli

You've gone to a lot of trouble to help me - thank you so much!

I'll have go and let you know - seems I did most of it - just hadn't got round to adding the path variables and doing a re-boot! Since this server is 'live' I'll have to pick my time to re-boot - but them the MS fortnightly patch up of holes is also awaiting a re-boot as well! Shame Novell caved in - oh well another soap box another time! I'll keep you posted.

Thanks again - above and beyond the call of duty!
Sep 8 '07 #6
gchq
96
MMMmm

libeay32.dll and ssbeay32.dll are in the main PHP directory and I entered libeay32 and ssbeay32 in the PATH statement and pointed them to the directory and files

php_curl.dll is in the PHP/Extensions directory

The php.ini file is:-

cgi.force_redirect = 0
asp_tags = true
extension_dir = C:\php\extensions
extension=php_curl.dll

re-booted and nothing... sigh!
Sep 9 '07 #7
Atli
5,058 Expert 4TB
Damn :/
Maybe this works differently in PHP4.
Just for to be thorough... What exactly did you put in the PATH variable?
(don't know if I spelled 'thorough' correctly :P)

Have you considered updating to PHP5 ?
If you need any incentive, check out the second post at php.net [13-Jul-2007]
(Or even gophp5.org)
Sep 9 '07 #8
gchq
96
Path variables were

Variable Name ibeay32
Variable Value C\PHP\ibeay32.dll

and

ssleay32
C:\PHP\ssleay32

Can't remember what the issue was after the last upgrade - but there WAS a reason to stay with PHP 4x and not upset the already sailing boat!:
Sep 9 '07 #9
gchq
96
I wonder if the issue could be do do with Apache (that you used) and IIS that I use?

It would appear that IIS is configured in CGI mode only! Not sure of the implications!
Sep 9 '07 #10
Atli
5,058 Expert 4TB
I just appended this: 'C:\Program Files\PHP\', the path where I put the .dll files, onto the PATH variable.

I don't think it will matter if it is in CGI mode or not.
From what I have read, the cUrl module should load normally, like it does when used as a module. Tho there may be some weird behavior in rare cases when run in CGI mode.
Sep 9 '07 #11
gchq
96
Just to be sure -we are talking about the main Windows 'Path' (as in an old DOS user)?

Right Click My Computer
Properties
Advanced
Environment Variables (this used to be called Path in the DOS days)

You then get to add the variable and the value as a paired set
Sep 9 '07 #12
Atli
5,058 Expert 4TB
Your in the right place, but there should already be a system variable called 'Path' (the case can vary). If it doesn't exists you can create it.

You should add the path to the .dll's to the value of that.
Sep 9 '07 #13
gchq
96
Seems like I'm having one of those days - sooooo it's now as it should be in the path variable. I've re-booted the server but still no joy! Is there any way of knowing is the cURL module has loaded?

I might just try installing 5x on my PC and see what happens.
Sep 9 '07 #14
kovik
1,044 Expert 1GB
I could have sworn cURL was automatically enabled in PHP5 installations. Are you sure it doesn't work?
Sep 9 '07 #15
gchq
96
I've installed 5.x on my local machine and still no joy - I've done everything but the re-boot (it's a long winded nightmare with all the shit thal's loaded).

A bit of background - I'm a .NET developer and know very little about PHP apart from minor edits to php pages. I'm attempting to get an flickr lookup element working within a Rich Text Editor written by Dav Glass (now at Yahoo), and this requires cURL. All I can establish is that the test page doesn't respond as it should! For all I know perhaps the cURL module HAS loaded and there is another issue. If the calling page is run it returns the error - "Fatal error: Call to undefined function: curl_init() in ....."
Sep 9 '07 #16
gchq
96
I was wrong - it DOES run on my development PC - so I guess the issue is to do with upgrading to PHP 5x

Thank you again for all your help
Sep 9 '07 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Haluk Durmus | last post by:
Hello I checked out openssl,mm,apr,apr-util,apache 2,curl,libxml and php from cvs. php couse an ERROR I did the following steps:
8
by: mrbog | last post by:
1. In order to make an http (or https) request with PHP, I need to recompile php with cURL. 2. In order to install CURL I have to upgrade my openssl rpm, even though I'm runing a version of...
3
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo():...
3
by: Hans | last post by:
Hi everybody, I am desperately trying to log into my account at godaddy.com with PHP and Curl and just cannot make it happen. Has anybody written a script for this purpose? Here is what I...
9
by: Conrad F | last post by:
Hi, If any Microsoft people are listening.... Are there any plans for the new web language called "Curl" to be supported in .NET (ASP.NET)? I ask as Curl represents the first step to true OO...
0
by: nfhm2k | last post by:
I've been trying to find a solution to this for quite some time now... I even took a look at existing scripts... Including this one......
4
by: zorro | last post by:
Hello there, I can't figure out why is it that when i use an array for my postfields it doesn't work : this works curl_setopt($curl, CURLOPT_POSTFIELDS, "clown=bozo" ); this doesn't...
0
by: xerc | last post by:
I am trying to create a generic function I can call to download all files from a single remote FTP directory -- using CURL. I want to multi-thread it, but need to get the single thread functionality...
3
by: rottmanj | last post by:
I am re-writing my rets application in perl, and I have found a few modules that will help me on my way. One of them being WWW::Curl:easy. During my testing, I have tested both system curl and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.