Executing the script from the command line, the owner of the generated and exported file is root, which adds an obstacle to the two processing of webserver.
(1) through Su www can solve this problem
However, in the case of the/sbin/nologin specified by the security www user's shell, this means that this cannot be toggled through SU.
(2) To specify permissions by modifying the umask of profile files, equivalent to chmod
This method is not only troublesome, but also unsafe
(3) activating via Curl
This is also a way to add in the code:
The code is as follows |
Copy Code |
<?php Ignore_user_abort (true);?> |
(4) through Crontab-u www-e
This method is more reliable, with the prevention of repeated execution of the script
code is as follows |
copy code |
<?php if (intval (shell_exec ps-ef|grep. basename (__file__)) |wc-l) exit (' repeat process ');//Prevent duplicate running ? |