My working index.php that runs in a browser looks like this:
<?php
$dbh = new PDO(...whatever
It works in a bowser just fine. I can do anything.
Running in terminal like:
shell> php index.php
I get some error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /Library/WebServer/Documents/index.php:3
Stack trace:
#0 /Library/WebServer/Documents/index.php(3): PDO->__construct('mysql:host=loca...', 'root', 'frekinpassword')
#1 {main}
thrown in /Library/WebServer/Documents/index.php on line 3
What's going on here?