I have put PushChatServer dir in htdocs folder and create database puschat try to run @\"http://localhost/PushChatServer/api/test/database.php\"
Then I got following
Quick test (run in shell):
php -r "new PDO('mysql:hostname=localhost;dbname=test', 'username', 'password');"
SQLSTATE[HY000] [2002] No such file or directory means php cannot find the mysql.default_socket file. Fix it by modifying php.ini file. On Mac it is mysql.default_socket = /tmp/mysql.sock (See PHP - MySQL connection not working: 2002 No such file or directory)
SQLSTATE[HY000] [1044] Access denied for user 'username'@'localhost' CONGRATULATION! You have the correct mysql.default_socket setting now. Fix your dbname/username/password.
Also see Error on creating connection to PDO in PHP