Solution to insufficient php writing memory: 1. Modify [php.ini]; 2. Add relevant statements in the program, the code is [ini_set(''memory_limit'', ''12M'') ]; 3. Create a [.htaccess] file in the root directory.
The operating environment of this tutorial: Windows 7 system, PHP version 5.6, DELL G3 computer. This method is suitable for all brands of computers.
Solution to insufficient php writing memory:
1. Modify php.ini (recommended)
memory_limit = 12M
2. Add the following to the program Statement
ini_set(''memory_limit'', ''12M'');
3. Create a .htaccess
file in the root directory and add the following content
php_value memory_limit 12M
If it still cannot be solved, change it to a larger size.
4. Add <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"> php_value max_execution_time 1200
php_value memory_limit 200M
php_value post_max_size 200M
php_value upload_max_filesize 200M</pre><div class="contentsignin">Copy after login</div></div> at the beginning of the .htaccess<p> file. For general virtual hosts, you can set the server by <code>.htaccess
Solve related problems. This method also applies to similar problems caused by other PHP programs.
Finally just restart the server!
Related video recommendations: PHP programming from entry to proficiency
The above is the detailed content of What to do if there is insufficient memory for writing to php. For more information, please follow other related articles on the PHP Chinese website!