There are always problems with production. It seems that the memory is full, which makes it impossible to request
situation:
1. Machine clusters are built with containers
2. The request always appears 502, and it will appear after restarting PHP FPM
3. Open the error log configuration
Of course, you can’t turn off opcache directly. You will find that there is no cache. The memory is very high
Open the error log, and the log will appear in/var/log/PHP FPM/error.log
VI/etc/php-fpm.d/w8002.conf # select different conf files according to which group you want to change
Add a line at the end: catch_ workers_ output = yes
Php5.6 has been reported Zend_ mm_ Heap corrupted with standard PHP 5.6: locating the cause and “Zend”_ mm_ “Heap corrupted” looks like a memory explosion. After a turn, it’s the problem of opcache. Try to disable it, modify the configuration in php.ini and restart PHP FPM
View PHP error log
[root@ip php-fpm]# grep zend error.log | tail -n 3
[01-Jun-2021 00:21:01] WARNING: [pool www8002] child 20812 said into stderr: "zend_mm_heap corrupted"
[01-Jun-2021 00:27:49] WARNING: [pool www8002] child 32582 said into stderr: "zend_mm_heap corrupted"
[01-Jun-2021 00:28:06] WARNING: [pool www8002] child 339 said into stderr: "zend_mm_heap corrupted"
cat php.ini | grep "opcache"
1. /etc/php.d/opcache.ini 改 "opcache.enable=0"
2. systemctl restart php-fpm
Key point: of course, you can’t turn off opcache directly. You will find that the cache memory is too high, so you can’t turn off opcache directly. Let’s start tuning opcache
; switch on
opcache.enable=1
; available memory, as appropriate, in megabytes
opcache.memory_consumption=256
Maximum number of files to cache, try to increase this value if the hit rate is less than 100%
opcache.max_accelerated_files=5000
opcache.max_accelerated_files=5000 ; Opcache will check the modification time of files within a certain period of time, here set the check time period, the default is 2, in seconds
opcache.revalidate_freq=240
The memory size of the interned string, also adjustable
opcache.interned_strings_buffer=8
whether to fast shutdown, the speed of reclaiming memory will be increased when PHP Request Shutdown is turned on
opcache.fast_shutdown=1
Do not save file/function comments
opcache.save_comments=0
Reference Links:
1.https://stackoverflow.com/questions/2247977/what-does-zend-mm-heap-corrupted-mean
2.https://stackoverflow.com/questions/50769286/zend-mm-heap-corrupted-with-standard-php-5-6-locating-the-cause
Read More:
- How to solve Magento 500 internal server errors
- How to Solve phpExcel Error: ERR_INVALID_RESPONSE
- How to Solve PHP Error: no package’oniguruma’ found
- How to Solve PHP Fatal error: Namespace declaration statement has to be the very first statement
- php_network_getaddresses: getaddrinfo failed (How to Fix)
- PHP: How to parse MHT file into HTML
- How to Hide index.php
- [PHP] Solve PHP Call to undefined function ldap_connect()
- Leetcode 357: How to calculate the number of digits with different digits
- [PHP] Solve the limitation of uploading files in nginx php 413 Request Entity Too Large
- Using $this when not in object context in (How to Fix)
- [PHP] Solve the problem that the new version of Chrome’s same-site policy cannot record cookies across domains
- PHP: How to get the total number of data in the MySQL table (total number of rows)
- [PHP] Solve Call-time pass-by-reference has been removed
- [PHP] Solve the 500 error problem-nginx and fpm have no error logs
- [PHP] php8 jit does not support 32-bit systems WARNING: JIT not supported by host architecture
- [Solved] PHPMailer Failed to Send Email: SMTP Error: Could not connect to SMTP host.
- php Error: mail() Failed to connect to mailserver at “localhost” port 25
- [Solved] WordPress Upgrade PHP 5.6 to 7.x Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- [Solved] Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: