Jump to content

Problem with command line scripts


lpa
 Share

Recommended Posts

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
 
Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...