I'm using from ssh:
php filename.php
and works great, but when I do this:
php filename.php?id=2
I get a "could not open input file" error.
any ideas?
You can't pass GET variables via the command line!! If you need to pass a variable to your script you can use php filename.php your_variable and use $argv and $argc in your PHP code.
PHP file's that were written as a website will only be of limited use on CLI.
You could write a wrapper script, that prepares the superglobals and include's the webscript.
I recommend reading about the CLI interface to understand what it does.
You need to pass your parameters as arguments instead and use $argv:
<?php
var_dump($argv);
?>
filename.php?id=2