stevepony

Can't decrease PHP execution/timeout time (FM

Discussion created by stevepony on Dec 15, 2016
Latest reply on Dec 16, 2016 by user19752

Dear all,

 

I'm having an issue with the timeout/execution time using PHP. What I'm trying to do is test whether a Filemaker Database is available or not by using below script:

 

$connected = $fm->listLayouts(); if(FileMaker::isError($connected)) { die('Error - ' . $connected->getCode() . ' ' . $connected->getMessage()); }

 

Problem is it takes the script 60sec to show below error:

Error - 7 Communication Error: (7) Failed to connect to 103.22.180.61 port 80: Connection timed out

 

This is too long. Is there a way to script in PHP to try connecting to the database and if it doesn't work within 10sec, just stop trying to connect and show the error (or do anything else) right away? I tried...

 

set_time_limit(10); //OR ini_set('max_execution_time', 10); if(FileMaker::isError($connected)) { die('Error - ' . $connected->getCode() . ' ' . $connected->getMessage()); }

 

But it didn't work. Still 60 sec. Any ideas on that? I did trying to research on my own for an hour already, without any success... Thank you so much!

Outcomes