Skip to content

Tag: connection

PDO connection works from command line, but not through Apache?

I have a very simple test script: When I execute this script from the command line, it works perfectly: But when I access the exact same script through my web browser, it says: I’ve tried var_dump on the error, and the message is: “SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘’ (13)”. This is puzzling. It’s the exact same

Does PHP run in background when browser is closed?

I start my browser and run a PHP program (in another server) and them I close the browser, the program will still keep running in the server, right? What if you run the program and them remove the folder in the server (while the program is running). Assuming its a single PHP file, will it crash? Does the whole PHP