D
D
DTX2017-06-16 10:37:45
PHP
DTX, 2017-06-16 10:37:45

Why doesn't PHP always connect to an external whine DB?

Periodically, with a probability of 50%, when trying to connect to an external whining database via PHP (PDO), an error occurs:
SQLSTATE[HY000] [2002] An attempt to establish a connection was unsuccessful, because. the required response was not received from another computer within the required time, or an already established connection was terminated due to an incorrect response from an already connected computer.
Tried different versions of PHP, now settled on PHP-7+Apache. Windows 10. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-06-16
@DirecTwiX

They say that vagrant helps to get rid of such problems, but I didn’t understand the joke at all to set up the test environment for an hour or two, and then also run it for 10 minutes.

there is already a decently working Linux Subsystem.
Set up in 5-10 minutes, add php ppa and install it + mysql or whatever else you need.
Everything is done in one team.
There is a webserver in php for tests.
php -S 127.0.0.1:80
why a lot of options are not connected.
The simplest actually bugged the server or the connection is really slow.
In any case, it is not the most successful case to work from a local location with a remote server.
You can try to use SSH Tunnel and forward the connection through it. Should be more stable. but not a fact.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question