How to execute a shell script by clicking on a link in a PHP Web page
Title, did a PHP build ExL program, want to click on the page link can call this php generation ExL, how to do?
What I do now is to make a link to the Web page, linked to getexl.php, as follows:
Web calling code:
Generate ExL
getexl.php Code:
System ("/usr/local/bin/php/www/xxxx/exllfile.php");//Generate EXL Program
?>
Dot link after ie below the progress bar is very slow, can not execute. /www/xxxx/exllfile.php This program a bit of a problem no, Linux run only a few seconds, what is the problem?
------Solution--------------------
There's no permission.
------Solution--------------------
Reference:
dot link after ie below the progress bar is very slow, can not execute.
Whether the file is not generated or the files that were generated cannot be downloaded.
If a file is generated, it cannot be downloaded. /usr/local/bin/php/www/xxxx/exllfile.php
After generating the ExL file, do you have the contents of the header and the echo file set?
For example, the generated file name is 1.xls.
Because you need to notify the browser to download, you need to set the header.
Header (' Content-type:application/octet-stream ');
Header (' Content-disposition:attachment;filename=1.xls ');
Header (' Content-length: '. FileSize (' 1.xls '));
ReadFile (' 1.xls ');
------Solution--------------------
Whether PHP is shutting down the system function. Disabled_function parameters
------Solution--------------------
Reference:
is it OK to set this parameter to ON, so disable_functions = on?
No, this location is filled out to disable the method. For example:
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
------Solution--------------------
Reference:
What should I do with the system function that opens PHP?
Remove the system function from the Disable_functions segment in the configuration file
------Solution--------------------
Check Safe mode ....
Also, do you need to generate EXL?