Home>Article>Backend Development> How to solve the problem that PHP does not generate core files when executing shell scripts

How to solve the problem that PHP does not generate core files when executing shell scripts

*文
*文 Original
2018-01-02 16:00:56 1671browse

How does PHP solve the problem of not generating core files when executing shell scripts? Today I will bring you a method to solve the problem that PHP does not generate core files when executing shell scripts and running programs. Share it with everyone and give it as a reference. I hope to be helpful.

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

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

To solve the problem, the core file can be generated.

Related recommendations:

php multi-threading method - shell

Analysis of using PHP shell script

Code to use php shell command to merge images

The above is the detailed content of How to solve the problem that PHP does not generate core files when executing shell scripts. 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