lpa Posted February 8, 2013 Posted February 8, 2013 Trying just this: #!/usr/bin/php <?php include("./index.php"); echo 'here we go'; I get this error: Error Exception: DB connect error 2002 - No such file or directory (in /Library/WebServer/Documents/pw22/wire/core/ProcessWire.php line 95) I am on Mac OS X 10.6 with PW 2.2.9. I don't understand what goes wrong? Lauri
apeisa Posted February 9, 2013 Posted February 9, 2013 Lauri, this might help: http://stackoverflow.com/questions/1676688/php-mysql-connection-not-working-2002-no-such-file-or-directory See also the comments on approved answer. PW uses mysqli. 1
ryan Posted February 9, 2013 Posted February 9, 2013 Are you running MAMP or something like that? If so, /usr/bin/php is not your PHP (at least, not the one you want). You probably want your script pointing to something like: /Applications/MAMP/bin/php/php5.3.6/bin/php (depending on what PHP version you have)
lpa Posted February 9, 2013 Author Posted February 9, 2013 Thanks for your help again! The problem was that I am using not the Apple provided php but something installed in /usr/local/php5/bin/php. And I didn't remember this, because I haven't used the PHP CLI much.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now