call a php file
Im trying to call a php file in a linux bash script is this correct syntax?
#!/bin/bash /usr/etc/script.php ??? thanks |
PHP files are usually not executable (unless you put a shebang on their first line and then give them executable permission); so try "php /usr/etc/script.php". Also, keep in mind that it outputs a complete HTML file including the headers.
|
If:
the PHP script is marked executable AND the first line is a #! line with the path to your PHP binary. otherwise, you'd be better off specifying the path to the PHP binary and the name of the script on the command line itself. Code:
#!/bin/bash |
You might also need to install php-cgi in order to run PHP scripts from the command line
|
All times are GMT -5. The time now is 11:01 PM. |