It turns out PHP xxx.php to run this PHP script.
In the Linux system
Want to use./xxx.sh to replace the top
Do not know whether it is feasible?
Reply content:
It turns out PHP xxx.php to run this PHP script.
In the Linux system
Want to use./xxx.sh to replace the top
Do not know whether it is feasible?
feasible,
#!/bin/bash# author: gm100861PHP=/usr/local/php/bin/php$PHP youphpfilename.php
Do you want to execute the PHP script directly?
1.在xxx.php开头加上#!/usr/local/php/bin/php2.chmod +x xxx.php3. ./xxx.php
That's the kind of shell you're using.
If it's bash, it's not a good idea, just pass the file name to the shell and call PHP to run.
If it is zsh, you can edit the. ZSHRC, using the Alias-s command, to specify which command to execute when you enter *.php directly. For example:
Alias-s php= ' php ' #在shell输入 run when *.php
Alias-s php= ' vim ' #在shell输入 open when *.php
Alias-s php= ' php-l ' #在shell输入 *.php when checking for syntax errors
Yes, just like inside the shell script.php ***.php
You can also specify the execution time and period by crontab
http://segmentfault.com/q/1010000003731015/a-1020000003732913