怎么在PHP WEB页面点击链接执行SHELL脚本

WBOY
リリース: 2016-06-13 11:54:42
オリジナル
1153 人が閲覧しました

如何在PHP WEB页面点击链接执行SHELL脚本
如题,做了个PHP生成EXL的程序,想在页面点击链接能调用这个PHP生成EXL,如何实现?

我现在做法是在WEB页面做了个链接,链到getexl.php,如下:

WEB调用代码:
生成EXL

getexl.php代码:
system("/usr/local/bin/php /www/xxxx/exllfile.php");//生成EXL程序
?>

点链接后IE下边进度条非常慢,执行不了。 /www/xxxx/exllfile.php这个程序一点问题没有,LINUX下运行只有几秒钟,这是什么问题?

------解决方案--------------------
没有权限了吧
------解决方案--------------------

引用:
点链接后IE下边进度条非常慢,执行不了。 

是没有生成文件还是生成了文件不能下载。
如果是生成了文件不能下载。/usr/local/bin/php /www/xxxx/exllfile.php
生成exl文件后,有设置header与echo 文件内容吗?

例如生成的文件名是1.xls。
因为你是需要通知浏览器下载的,需要设置header。
<br />header('content-type:application/octet-stream');<br />header('content-disposition:attachment;filename=1.xls');<br />header('content-length:'.filesize('1.xls'));<br />readfile('1.xls');<br />
ログイン後にコピー

------解决方案--------------------
是否是php关闭了system函数。 disabled_function参数
------解决方案--------------------
引用:
是把这个参数设成on就可以吧,这样disable_functions = on?


不是,这个位置是填写想禁用的方法。例如:
disable_functions = system,exec,shell_exec,passthru,proc_open,proc_close, proc_get_status,checkdnsrr,getmxrr,getservbyname,getservbyport, syslog,popen,show_source,highlight_file,dl,socket_listen,socket_create,socket_bind,socket_accept, socket_connect, stream_socket_server, stream_socket_accept,stream_socket_client,ftp_connect, ftp_login,ftp_pasv,ftp_get,sys_getloadavg,disk_total_space, disk_free_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname 
------解决方案--------------------
引用:
那打开PHP的system函数应该怎么设呢?


把 system 函数从 配置文件中 disable_functions 段中删除
------解决方案--------------------
检查安全模式。。。。

另外,生成exl也不用这样吧?
関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!