如何使用shell脚本从另一个服务器调用PHP?我有一个PHP和shell脚本,这两个文件存储在不同的服务器上。
我有这样的剧本:
#!/bin/bash
php "http://example.com/csv_import.php"
但是当我手动运行这个命令时,我得到了一个错误:Could not open input
如何正确使用shell脚本调用PHP?
当monit超时服务时,如何执行脚本作为最后一步?
我的配置如下所示:
check process php5-fpm with pidfile /var/run/php5-fpm.pid
start program = "/usr/sbin/service php5-fpm start"
stop program = "/usr/sbin/service php5-fpm stop"
if failed unixsocket /var/run/php5-fpm.sock then restart
if 3 restarts wi
我正在使用system()在PHP中执行Python脚本。为了获得Python的结果,我使用print命令并在PHP中捕获结果。这是我的密码:
Python (test.py)
import sys
name = sys.argv[1]
print 'Your name is ' + name
$result = system('python test.py John');
echo $result;
/* PHP Output */
Your name is John
Your name is John
如您所见,输出翻了一番。第一个是由Python脚本本