~~~
shell_exec() has been disabled for security reasons
打開php.ini,搜索disable_functions,代碼如下:
disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,
ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen 把shell_exec刪除即可,保存。
~~~
~~~
nohup php monitor.php > ./a.txt &
后臺持續開啟執行 monitor.php
ps -aux|grep monitor.php | grep -v grep | awk '{print $2}'
關閉后臺進程
~~~
~~~
## 1、允許單個域名訪問
指定某域名(http://client.runoob.com)跨域訪問,則只需在http://server.runoob.com/server.php文件頭部添加如下代碼:
~~~
header('Access-Control-Allow-Origin:http://client.runoob.com');
~~~
## 2、允許多個域名訪問
指定多個域名(http://client1.runoob.com、http://client2.runoob.com等)跨域訪問,則只需在http://server.runoob.com/server.php文件頭部添加如下代碼:
~~~
$origin = isset($_SERVER['HTTP_ORIGIN'])? $_SERVER['HTTP_ORIGIN'] : '';
$allow_origin = array(
'http://client1.runoob.com',
'http://client2.runoob.com'
);
if(in_array($origin, $allow_origin)){
header('Access-Control-Allow-Origin:'.$origin);
}
~~~
## 3、允許所有域名訪問
允許所有域名訪問則只需在http://server.runoob.com/server.php文件頭部添加如下代碼:
~~~
header('Access-Control-Allow-Origin:*');
~~~
~~~