Home / Software / PHP Memory Limit

PHP Memory Limit

PHP Elephant

Question: My PHP content management program “X” needs more RAM. How do I fix this?

Answer: Depending on your server setup and whether you have shared hosting or a dedicated server, you may or may not be able to change the allowed PHP memory usage. What happens is that PHP is setup to allow a certain amount of data to be sent over the web before it times out and give you an error. The default is usually 8MB, which is not enough for large databases.

The solution is to increase the memory allowance. Normally, if it is done server-wide, you simply edit the php.ini file and find something that looks like:

“memory_limit = 8M”

If you want a 32MB limit, simplyl change it to:

memory_limit = 32M

If you are using a shared hosting account, there are several methods that a web hosting provider can use to allow you to change the settings, while some might not allow it at all. Check their documentation and, if necessary, contact them.

Photo Source: Flickr

Check Also

servers

Importance of web hosting to business

The world of business is very ruthless and unfair in some cases. It is a …