Home >Backend Development >PHP Problem >What to do if there is insufficient memory for writing to php

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

coldplay.xixi
coldplay.xixiOriginal
2021-02-23 17:24:412184browse

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

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 <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> at the beginning of the

.htaccess

file. For general virtual hosts, you can set the server by .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!

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