{"action":"created","issue":{"url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3398","repository_url":"https://api.github.com/repos/wp-cli/wp-cli","labels_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3398/labels{/name}","comments_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3398/comments","events_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3398/events","html_url":"https://github.com/wp-cli/wp-cli/issues/3398","id":176663365,"number":3398,"title":"PHP Warnings and fatal errors ","user":{"login":"halian-vilela","id":1423653,"avatar_url":"https://avatars.githubusercontent.com/u/1423653?v=3","gravatar_id":"","url":"https://api.github.com/users/halian-vilela","html_url":"https://github.com/halian-vilela","followers_url":"https://api.github.com/users/halian-vilela/followers","following_url":"https://api.github.com/users/halian-vilela/following{/other_user}","gists_url":"https://api.github.com/users/halian-vilela/gists{/gist_id}","starred_url":"https://api.github.com/users/halian-vilela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halian-vilela/subscriptions","organizations_url":"https://api.github.com/users/halian-vilela/orgs","repos_url":"https://api.github.com/users/halian-vilela/repos","events_url":"https://api.github.com/users/halian-vilela/events{/privacy}","received_events_url":"https://api.github.com/users/halian-vilela/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wp-cli/wp-cli/labels/state:unsupported","name":"state:unsupported","color":"c2e0c6"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-13T14:54:30Z","updated_at":"2016-09-13T16:23:10Z","closed_at":"2016-09-13T16:23:10Z","body":"Whenever I try to use wp-cli within a running WP installation I get the following errors:\r\n\r\n```bash\r\nPHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 1529\r\nWarning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 1529\r\nPHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 1559\r\nDeprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 1559\r\nPHP Warning:  mysql_connect(): No such file or directory in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 1559\r\nWarning: mysql_connect(): No such file or directory in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 1559\r\nPHP Fatal error:  Call to undefined function wp_die() in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 3160\r\nFatal error: Call to undefined function wp_die() in /Applications/MAMP/htdocs/inspirassom/wp-includes/wp-db.php on line 3160\r\n```\r\n\r\nI guess it has something to do with my PHP versions (cli and web) being out of sync. I'm using MAMP so if I run `wp --info` I get:\r\n\r\n```bash\r\n$ wp --info\r\nPHP binary:\t/usr/local/Cellar/php56/5.6.20/bin/php\r\nPHP version:\t5.6.20\r\nphp.ini used:\t/usr/local/etc/php/5.6/php.ini\r\nWP-CLI root dir:\tphar://wp-cli.phar\r\nWP-CLI packages dir:\r\nWP-CLI global config:\r\nWP-CLI project config:\r\nWP-CLI version:\t0.24.1\r\n```\r\n\r\nwhile running `which PHP` yields:\r\n\r\n```bash\r\n$ which php\r\n/usr/local/opt/php56/bin/php\r\n```\r\n\r\nAbout `$WP_CLI_PHP`, it was undefined (I had to comment it out due to previous issues) but it doesn't seem to make any difference if I set it to MAMP's version or the Homebrew one's stated as above.\r\n\r\nSo, any help? I'm rather confused by this issue and WP-CLI is such a nice tool to have under my belt.\r\n"},"comment":{"url":"https://api.github.com/repos/wp-cli/wp-cli/issues/comments/246739066","html_url":"https://github.com/wp-cli/wp-cli/issues/3398#issuecomment-246739066","issue_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/3398","id":246739066,"user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T16:23:10Z","updated_at":"2016-09-13T16:23:10Z","body":"Hi @halian-vilela,\r\n\r\nGithub issues are no longer an appropriate venue for support questions. Please review http://wp-cli.org/#support"}}
{"actor":{"display_login":"danielbachhuber"}}