I have a c++ cgi program that uses cURL to communicate to paypal. I'm attaching the whole file. There's a lot of commented out nonsense in there from various things I've tried, but I don't think the code is the problem anyway. So here we go.
I can run a cURL program in c++ from the command line. I'm using cURLpp and I ran the examples with no problem.
If I run the compiled CGI it dies with no error, and no message whatsoever at request.perform(). By dies I mean, if I don't print the necessary http headers before running perform() I get a "Premature end of script headers" error and apache goes 500 on me. If I do print out the headers I simply get a blank white screen.
I have a series of catch blocks set up, the last of which is a catch all. None of them are called.
After some tinkering I discovered that if I don't set the URL option I can run perform() just fine. Of course it hits one of the catch blocks and throws the error that the URL is not set, but it doesn't just die. I can set any option except URL without a problem.
So here are my thoughts, permissions issue with the cgi using an outgoing port. I'm running from the command line with root, and while I set the cgi program to be owned by root, it doesn't seem to be working out for me.
I've tried changing the owner and group of the example file that worked to match those of the cgi application and the example still worked. So maybe it's using a different port within the compiled CGI?
The problem is, while I can get around in unix, I wouldn't even know where to begin looking for something like this. How do I check whether or not this could be a permissions issue? Does that even sound like it could be the cause? How would I go about remedying something like that?
I'm getting pretty desperate here. I'm in over my head and I'm starting to drown a little bit.