Problems using PHP and CURL

Harry van der Wolf hvdwolf at gmail.com
Fri Jan 23 09:51:04 PST 2009


Please check which curl version is used. curl is part of MacOsx and resides
in /usr/bin/curl. Macports curl is in /opt/local/bin. If I compare them I
see that they are not equally compiled with equal dependencies on my system
(10.5.6).  Normally when macports is installed it places /opt/local/bin as
first search path in your PATH. Your previous install might have used the
/usr/bin/curl wheras your macports install uses /opt/local/bin/curl.
You could try to systematically rename them (or do a sudo port deactivate
curl) and check if the "standard"  macosx curl gives you a different
message/error.

Harry



2009/1/23 Craig Hoffman <choffman at eclimb.net>

> Ok this strange -
> When I put this URL (https://test.authorize.net/gateway/transact.dll) in
> your CURL example, you get this response:
> The following errors have occurred.
> (13) The merchant login ID or password is invalid or the account is
> inactive.
>
> But when running MacPorts PHP it returns blank.  This example returns the
> correct response with Marc's PHP package (5.2.5).
> Could this be perhaps an Apache thing?
>
>        <?php
>                $ch = curl_init();
>                curl_setopt($ch, CURLOPT_URL, "
> https://test.authorize.net/gateway/transact.dll");
>                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>                $response = curl_exec($ch);
>
>                curl_close($ch);
>                echo $response;
>        ?>
> _______________________
> Craig Hoffman
> iChat / AIM: mountain.dog
> _______________________
>
>
>
>
>
> On Jan 23, 2009, at 9:36 AM, Craig Hoffman wrote:
>
>  what does the following PHP example do?  I get this:
>>>
>> You have reached this web page by typing "example.com", "example.net", or
>> "example.org" into your web browser.
>> These domain names are reserved for use in documentation and are not
>> available for registration. See RFC 2606, Section 3.
>>
>> Ok, I guess CURL is working. Excellent.  I wonder why my script doesn't
>> work with MacPorts PHP...
>>
>> _______________________
>> Craig Hoffman
>> iChat / AIM: mountain.dog
>> _______________________
>>
>>
>>
>>
>>
>> On Jan 23, 2009, at 9:23 AM, Chris Janton wrote:
>>
>>  On 2009-01-23 , at 08:57 , Craig Hoffman wrote:
>>>
>>>  Thanks for responding.  I pasted a code snippet below.  Basically it
>>>> sends an array to Authorize.Net for processing.   Authorize.Net responds
>>>> with transaction details (approved, declined, wrong address, etc...).
>>>> When CURL is working, using Liyanage PHP I get this response:
>>>>
>>>
>>>
>>> what does the following PHP example do? In theory it will return the text
>>> of the web page which reads like this
>>> "
>>> You have reached this web page by typing "example.com", "example.net",
>>> or "example.org" into your web browser.
>>> These domain names are reserved for use in documentation and are not
>>> available for registration. See RFC 2606, Section 3.
>>>
>>> "
>>>
>>>
>>> <?php
>>> $ch = curl_init();
>>> curl_setopt($ch, CURLOPT_URL, 'example.com');
>>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>>> $output = curl_exec($ch);
>>> curl_close($ch);
>>> echo $output;
>>> ?>
>>>
>>> 8)
>>> ----------------------------------
>>> Chris Janton  - face at CentosPrime dot COM
>>> Netminder for Opus1.COM
>>>
>>>
>>>
>> _______________________________________________
>> macports-users mailing list
>> macports-users at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
>>
>
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20090123/fbeefe97/attachment.html>


More information about the macports-users mailing list