What to do if there is insufficient memory for writing to php

coldplay.xixi
Release: 2023-03-08 08:18:01
Original
2108 people have browsed it

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.

What to do if there is insufficient memory for writing to php

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
Copy after login

2. Add the following to the program Statement

    ini_set(''memory_limit'', ''12M'');
Copy after login

3. Create a .htaccess file in the root directory and add the following content

    php_value memory_limit 12M
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!