4

I'm connecting to a FireBird database, which works fine when the database is online. When the server is offline, the user gets an max execution time passed error.

Therefore I want to surround the connection statement with a try catch and set the timeout to 10 seconds. But I can't find the right attribute to do so. The default ATTR_TIMEOUT doesn't seem to work. Can anyone tell me if this is possible with PDO and FireBird?

1 Answer 1

5

Not sure about PHP / PDO but there is ConnectionTimeout parameter in the firebird.conf file you could try. The default value is 180 seconds (quote from conf file):

# ----------------------------
# Client Connection Settings (Basic)
#
# Seconds to wait before concluding an attempt to connect has failed.
#
# Type: integer
#
#ConnectionTimeout = 180

If your FireBird server is not in the same server where the PHP script runs and you don't have firebird.conf file on the "PHP server", then try to put one into same directory where the fbclient dll is. Or if there is FIREBIRD enviroment variable defined, then into the directory that var points to.

Sign up to request clarification or add additional context in comments.

1 Comment

Not what I was looking for but it is as close as it gets for this problem, thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.