Using PHPUnit

From Littledamien Wiki
Revision as of 16:46, 15 September 2015 by Video8 (talk | contribs) (Created page with "== Errors and fixes == === mysqli no such file or directory === Run a unit test that makes a database connection and receive <syntaxhighlight lang="text"> mysqli::mysqli()...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Errors and fixes

mysqli no such file or directory

Run a unit test that makes a database connection and receive

mysqli::mysqli(): (HY000/2002): No such file or directory

First Google results suggested making sure that the mysql extension was compiled into PHP. I don't think this was the actual issue.

I installed PHP using homebrew, according to these instructions. This version of PHP comes with MySQL compiled into it, but I think that PHP that comes installed on the Mac most likely does also.

The issue ended up being that the MySQL connection was configured to use localhost as the host name. locahost for the PHP CLI resolves to something very different than when running on the development web server. [1]

Notes

See also

Footnotes