P.S.: Ummm, I added the PHP code nicely as "Raw Html", but now it looks very bad. How come? How can I properly insert code in this forum?
If there is error on connection, it should be caught on creating $fm, not $connected.
Thank you, I tried as below, but it did not work. I think either I did something wrong or can't catch an error on $fm? It's only $fm =& new FileMaker();
die('Error - ' . $fm->getCode() . ' ' . $fm->getMessage());
Anyway the $connected script I found in the internet, many pages suggest doing it this way.
>> But this is not the main issue anyway. The script works. But the timeout of 60sec trying to connect to the Database until it finally fails and gives me the error, that's the problem.
Any idea? Thanks again!
Just got this reply at Stackoverflow:
set_time_limitpurely only for PHP script. If connection to Filemaker maybe timeout set somewhere else in the Filemaker configuration.
From PHP Doc;
Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.
Is there a way to decrease the timeout time for the PHP request to Filemaker Server?
I found in the "Manual" this:
Error 1629: Connection timed out; the timeout value is 60 seconds
>> So I think my question is, how to decrease those 60 seconds to 10 manually?
Ouch, very sorry, creating FileMaker object does nothing to connect, so you were correct. Some action with $fm will try connecting.
PHP API use curl to connect database internally, so you may need setting curl option, I don't know how do it.
You would need editing FileMakerImpl.php that has lines like
curl_setopt($Vd88fc6ed, CURLOPT_HEADER, true);
Ok no worries.
Oh dear, I don't have any idea as well.
>> Editing FileMakerImpl.php isn't an option in our case, I think.
Reason: Basically the 60sec are ok, in case the connection is slow. I just wanted it faster for the test connection.
Background of the whole thing: We are having problems with our hosting provider and their server, where Filemaker Server is running. I just want to prevent people are waiting 1 minute (when registering for an event), and after 1 minute they receive an error. My plan is - see if the connection works, if so, go ahead. But if not, Plan B: Save the pure data somewhere else and don't show funny errors to the client + loose the data.
Now I guess I could only switch to "emergency" plan after 60 sec. But it's so long... :-(
Hmm, I wrote "edit" but it is not need, you can write additional code connecting to XML interface which is used by PHP API then set time out for it.