[FX.php List] CURL error from FX.php response file

Chris Hansen chris at iViking.org
Tue Nov 20 08:52:28 MST 2007


Rodney,

Jonathan is right on track (i.e. he knows what he's talking  
about ;-).  Let me throw out a couple more things here:

1) When you say "The URL is Correct", have you actually turned on  
DEBUG, and attempted to access the resulting URL manually?  Note that  
this is most effective if you're able to attempt to connect FROM your  
web server to your FileMaker server.

2) Has the IP of the FileMaker server or the firewall settings  
between your servers changed recently?  Note that I've worked in a  
situation before where policy dictated that servers weren't allowed  
to make HTTP requests through the firewall, and I had to get this  
changed.

3) All of these errors are really all the result of the first error  
that you mention: "FX: cURL could not retrieve Post data in  
RetrieveFM7Data(). A bad URL is the most likely reason."  When FX  
encounters a serious error, it returns an FX Error Object, instead of  
the standard data array.  This means that you should check for errors  
each time you query FileMaker something like this:

if (FX::isError($searchResult)) {
     ... code here to handle FX.php errors ...
} elseif ($searchQuery->lastErrorCode != 0) {
     ... code here to handle FileMaker errors ...
} else {
     ... your normal data returning code here ...
}

Always trap for errors =)

If none of the suggestions provide help with your problem, or if you  
need additional clarification, just post back to the list.  Best,

--Chris Hansen
   FileMaker 8 Certified Developer
   FileMaker 7 Certified Developer
   Creator of FX.php
   "The best way from FileMaker to the Web."
   www.iViking.org


On Nov 20, 2007, at 7:22 AM, Rodney Schmidt wrote:

> Thank you, Jonathan. I am double-checking everything of course. It  
> all seems
> correct but files can get corrupted even on a commercial server  
> (perhaps
> *especially* on such?).
>
> Your insight does help and I thank you again.
> -- 
> Rodney Schmidt
>
>
>> Rodeny,
>>
>> I'll jump in with an answer before the folks that really know what
>> they are talking about .;-)
>>
>> When these same handful of errors pop up, it typically points to an
>> unsuccessful connection and query to the server.  The first place to
>> look: check and double check the FX instance set up on the offending
>> page: $serverIP, $DB,  etc.
>>
>> All the errors describe fx's displeasure when the script doesn't find
>> what it expects to find under normal circumstances.
>>
>> HTH,
>>
>> Jonathan
>>
>>
>> At 8:45 PM -0500 11/19/07, Rodney Schmidt wrote:
>>> Once again I seek advice from those more knowledgeable than myself.
>>>
>>> For over a year I have been running FX.php on a commercial web
>>> server (v. 4.4.4 is what is offered), accessing a database on a
>>> FMPSA, now version 9, with no problems at all.
>>>
>>> The form on the commercial server used to gather information submits
>>> to a "response.php" page, which sends the data on to FMS9A and the
>>> DB. With the FM DB open via the server on my own desktop, the data
>>> is quickly available and can be viewed.
>>>
>>> It has all worked very well. Tonight I begin receiving these
>>> messages from the commercial server (not the FMS9A server):
>>>
>>> (1) FX: cURL could not retrieve Post data in RetrieveFM7Data(). A
>>> bad URL is the most likely reason.
>>>
>>> (2) Warning: Cannot use a scalar value as an array in
>>> /home/fmpro2go/public_html/search.php on line 164
>>>
>>> (3) Warning: Invalid argument supplied for foreach() in
>>> /home/fmpro2go/public_html/search.php on line 164
>>>
>>> (4) Warning: Cannot use a scalar value as an array in
>>> /home/fmpro2go/public_html/response.php on line 48
>>>
>>> The PHP code respectively is:
>>>
>>> search.php on line 164: foreach( $searchResult['data'] as $key =>
>>> $searchData )
>>>
>>> response.php on line 48: $recordData = current($newrecordResult 
>>> ['data']);
>>>
>>> Once again, I would really appreciate some advice here. There has
>>> been no change to the FMS9A setup at all and it all worked fine
>>> yesterday when I ran a check.
>>>
>>> Today, zip with error messages. I have reloaded fresh copies of
>>> FX.pgp and Fxparser, and the files used including the
>>> "server_data.php" file. The URL is correct.
>>>
>>> Thank you very much.
>>> --
>>> Rodney Schmidt



More information about the FX.php_List mailing list