In Unix you need to specify the working folder when you are launching an
executable, otherwise Bash will try to look into its search path, which
does not include the current folder. Try:


That should work. BTW--running "test" by itself only *looks* like
hitting enter--it's really a valid command. Try man test for more info.


php|architect - The Magazine for PHP Professionals
The monthly magazine dedicated to the world of PHP programming

Check us out on the web at!
--- Begin Message --- I'm trying to do shell scripting in PHP. I have PHP installed in /usr/bin/php. I have the following script:
#!/usr/bin/php -q
print "Success!\n";
It's saved as test.php and CHMODed to 777. When I type "test.php" at the command line, it says:

bash: test.php: command not found

When I type "test", it acts like I just hit enter. Typing "/usr/bin/php -q test.php" does work. Does anyone know what I'm doing wrong?

The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

PHP General Mailing List (
To unsubscribe, visit:

--- End Message ---
PHP General Mailing List (
To unsubscribe, visit:

Reply via email to