I'm running RH 9 linux and read some articles on how to run a php script from the shell using the following:
#!/usr/bin/php -q
<?php
print("Hello, world!\n");
?>
I made 100% the path to php was correct and the script file is set as executable but this is what I get:
[root@testsrv5 tests]# ./test.php
Error in argument 1, char 3: option not found
Error in argument 1, char 3: option not found
Usage: php [-q] [-h] [-s [-v] [-i] [-f <file>] | {<file> [args...]}
From this point I tried taking the -q argument out and then I get:
: bad interpreter: No such file or directory
This one is a stumper for me, anyone have any ideas? BTW: I'm using the PHP 4.2.2 RPM that came with RH 9 and my scripts run fine through Apache.