Jump to content
Sign in to follow this  
Player0

LinkPoint API & CURL Suggestion

Recommended Posts

I found an interesting bug while using CURL, Apache2, PHP4 on a Win32 box just now. I have my osC stores running with the LinkPoint add-on module (which I've had to modify greatly to work right). I noticed weird dumpings in to my apachelogs.

 

Well, long story short, I'm using the command-line CURL calls since the PHP CURL calls dont work so hot with Win32 at the moment. You may recognize something like:

 

$result = shell_exec("$cpath -s -E \"$key\" -m 90 -d \"$xml\" $host");

 

Well, I added the -s parameter in to this call. This forces CURL in to silent mode and disables the progress bar etc which was finding its way in to my Apache logs for some reason (stdout conflict?)

 

Im not sure if recent versions of the Linkpoint module contain any such fixes (I dont remember what I fixed, there was a Subtotal non-matching bug due to some mixed up HTTP fields on linkpointms1 module and some other issues with like GV&CC add-on and such). I should keep better track of what I fix to help others but unfortunately Im always under a crunch for work hehe.

 

But yeah, I recommend the -s param on CURL calls. Probably for *nix too.

Share this post


Link to post
Share on other sites

I'm not a programmer, but I can still fix some code. I have exact some error. Linkpoint API gives me an error CURL could not be executed. can you, please, give better instructions on where shall I fix the code you provided? what file and what line?

 

thank you, your help will be greatly appreciated

Share this post


Link to post
Share on other sites
I'm not a programmer, but I can still fix some code. I have exact some error. Linkpoint API  gives me an error CURL  could not be executed. can you, please,  give better instructions on where shall I fix the code you provided? what file and what line?

 

thank you, your help will be greatly appreciated

 

 

I am getting the same error ~ please help . . .

Share this post


Link to post
Share on other sites

I don't know. There are several reasons it's not working. Yeah, I had these same problems when I tried to use the module. I can't really provide code since I've rewritten a lot of the module for my purposes. Even the new linkpoint module recently posted still has some bugs in terms of handling addresses, the subtotal when using CCGV add-on, etc. Honestly, you probably need a good programming handle with osC to make linkpoint work well at this point.

 

Anyway. If you're on a windows platform, just forget about using Curl functions through PHP. It just *doesnt* work right with SSL. Thats why I moved to the command line variants (you can enable this in lpphp).

 

The could not curl problem happens for several reasons itself. The first thing i did was add some debugging and echo out some more reasonable error messages based on where the problem is.

 

I *highly* recommend trying to perform the Curl manually to linkpoint. Download Curl, install it on a directory somewhere and from the command line, try to Curl connect to linkpoint and send some sample XML. This is the BEST way to make sure your PEM and SSL stuff is working properly. You'll also see much better error messages from the command line. Understand the curl flags and make sure you have it in verbose mode, not silent mode.

 

Thats really all I can say without more info to go on.

Share this post


Link to post
Share on other sites

As I recall on an install I did, the "Curl could not be excecuded" message is generated when a NULL return comes back from the Curl call. Curl may be setup just fine.

 

In my case Curl just couldn't get past the firewall I had setup. The documentation indicated that a certain port (i'm guessing at 1029) needed to be open for it to communcate with linkpoint.

 

As Tom (PlayerO) indicated, the best way is to perform the test API functions at the command line in verbose debug mode and you'll see what's happening much more clearly.

 

HTH

Tom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×