Home  >  Article  >  Backend Development  >  How to execute shell script running program in PHP without generating core file

How to execute shell script running program in PHP without generating core file

墨辰丷
墨辰丷Original
2018-05-29 10:10:031360browse

This article mainly introduces how to use PHP to execute shell scripts and run programs without generating core files. Friends who are interested can refer to it. I hope it will be helpful to everyone.

It is found that the core file is never generated, but when the script is manually run, the core file will be generated.

After guidance from a friend, it turned out that the problem was caused by the script execution environment:

Add ulimit -a >> 1.log to the script

Print as follows:

core file size     (blocks, -c) 0
data seg size      (kbytes, -d) unlimited
scheduling priority       (-e) 0
file size        (blocks, -f) unlimited
pending signals         (-i) 127364
max locked memory    (kbytes, -l) 64
max memory size     (kbytes, -m) unlimited
open files           (-n) 4096
pipe size      (512 bytes, -p) 8
POSIX message queues   (bytes, -q) 819200
real-time priority       (-r) 0
stack size       (kbytes, -s) 10240
cpu time        (seconds, -t) unlimited
max user processes       (-u) 127364
virtual memory     (kbytes, -v) unlimited
file locks           (-x) unlimited

core file size is actually 0

Run the program in the script Add a sentence before: ulimit -c unlimited

to solve the problem.

The core file can be generated.

The above is the entire content of this article, I hope it will be helpful to everyone's study.


Related recommendations:

webshellDetailed explanation of how to scan files for Trojans in PHP

php four functionsshell_exec, exec, passthru, system respectively usage scenarios

PHP sorting algorithm Hill sorting ( Shell Sort)

The above is the detailed content of How to execute shell script running program in PHP without generating core file. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn