How to connect to DB, when running via command line
问题 When I run zend framework project from browser, everything is OK, it connects to DB. When I run project from command line it can't connect to DB and it throws an error: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /usr/local/zend/share/ZendFramework/library/Zend/Db/Adapter/Pdo/Abstract.php:129 I have used Running a Zend Framework action from command line 's answers ( https://stackoverflow.com/a/4706966/457033 ) It's my