Home >Backend Development >PHP Problem >What to do if there is no coredump file in php

What to do if there is no coredump file in php

藏色散人
藏色散人Original
2021-05-25 09:16:181607browse

The solution to the problem that php does not have a coredump file: 1. Check whether there is a "ulimit -c 0" operation in the shell configuration; 2. Enable global coredump; 3. Exit and log in to the shell again, and modify the configuration.

What to do if there is no coredump file in php

The operating environment of this article: ubuntu 16.04 system, PHP7.1 version, DELL G3 computer

php What should I do if there is no coredump file? How to check the errors of php-fpm core dump file?

Enable PHP's coredump output and modify ulimit -c. However, in many cases, it will prompt that the rights are restricted and cannot be modified.

[fukun@10.16.29.xxx]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30678
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 32768
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) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
$ ulimit -c unlimited
-bash: ulimit: core file size: cannot modify limit: Operation not permitted

Solution:

1 .Check the configuration

See if there is a similar shutdown operation like ulimit -c 0 in the shell configuration, such as

$HOME/.bash_profile 或者 $HOME/.bashrc 之类的,如果有,注释掉。
#
# Do not produce core dumps
#
# ulimit -c 0

2. Turn on global coredump

Use the root user , modify /etc/security/limits.conf

# /etc/security/limits.conf
#
# Each line describes a limit for a user in the form:
#
# <domain> <type> <item> <value>
#
* soft core unlimited

3. Exit and log in to the shell again, modify the configuration

ssh fukun@10.16.29.xxx
[fukun@10.16.29.xxx]$ ulimit
-c
0

First switch to the root user for settings

su -
ulimit -c unlimited
ulimit -c
unlimited

and then switch Go back to your own user to set it up

su - fukun
ulimit -c unlimited
ulimit -c
unlimited

The above three steps may not be necessary, but as long as you follow this step, you will definitely be able to set it up successfully. If other methods fail to set up, try this step out. .

[Recommended learning: PHP video tutorial]

The above is the detailed content of What to do if there is no coredump file in php. 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