I have a software project with PHP 7 on XAMPP version 3.2.2
The problem is that the Apache keeps stopping constantly
I tried put this on the httpd.conf file but the problem persist
<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>
The error log shows this:
[Fri Jun 07 15:57:50.687867 2019] [php7:error] [pid 4924:tid 1620] [client 172.16.5.211:57554] PHP Fatal error: Out of memory (allocated 4194304) (tried to allocate 4096 bytes) in C:\\xampp\\apps\\moodle\\htdocs\\lib\\navigationlib.php on line 3297
[Fri Jun 07 15:57:55.140977 2019] [mpm_winnt:crit] [pid 4924:tid 472] AH02538: Child: Parent process exited abruptly. Child process is ending
[Fri Jun 07 15:57:58.922259 2019] [core:warn] [pid 872:tid 436] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Jun 07 15:57:59.000372 2019] [mpm_winnt:notice] [pid 872:tid 436] AH00455: Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.1 configured -- resuming normal operations
[Fri Jun 07 15:57:59.000372 2019] [mpm_winnt:notice] [pid 872:tid 436] AH00456: Apache Lounge VC15 Server built: Nov 3 2017 10:30:36
[Fri Jun 07 15:57:59.000372 2019] [core:notice] [pid 872:tid 436] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Fri Jun 07 15:57:59.000372 2019] [mpm_winnt:notice] [pid 872:tid 436] AH00418: Parent: Created child process 1872
[Fri Jun 07 15:57:59.719114 2019] [mpm_winnt:notice] [pid 1872:tid 460] AH00354: Child: Starting 150 worker threads.
I appreciate your help
You can run this: memory_get_usage
that returns the amount of memory allocated to PHP. ( https://www.php.net/manual/en/function.memory-get-usage.php )
And this: memory_get_peak_usage
that returns the peak of memory allocated by PHP. ( https://www.php.net/manual/en/function.memory-get-peak-usage.php )
Then tweak ini_set('memory_limit', '16M');
(16 M in the example, just set properly depending on what you get with the previous commands).
Here is the documentation for ini_set: https://www.php.net/manual/en/function.ini-set.php
You may find interesting hints here too: Fatal error: Out of memory, but I do have plenty of memory (PHP)
If you want to edit php.ini : memory_limit
is for configuring the maximum amount of memory in bytes that a script is allowed to allocate. ( https://www.php.net/manual/en/ini.core.php#ini.memory-limit )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.