How to set resource limits on PHP

posted: Tuesday 09 February 2010 by Tavis J. Hampton in: VPS & Dedicated Web servers Software

PHP logoIn a previous post, we learned how to increase the memory limit on PHP by editing the php.ini file. But limits exist for a reason, and although you would probably love to give every process, every script, and every website unlimited CPU cycles, memory, and bandwidth, it just isn’t possible.

To begin editing, open /etc/php.ini in your text editor of choice. For example:

# nano /etc/php.ini

Look for the following values and change them to fit your requirements for your server. Below are just suggested values:

max_execution_time = 30
max_input_time = 30
memory_limit = 40M
post_max_size = 8M
upload_max_filesize = 2M

You may need to adjust the actual size limits to meet the requirements of certain content management systems or scripts, but be sure to not get carried away with being too liberal.

1 stelle2 stelle3 stelle4 stelle5 stelle (no votes)
share this 0 comments

Be the first to add a comment to this article.

Your email address is required but won't be displayed.
Leave a comment

Register to reserve your nickname accross all the blogs in the Blogo network and to upload your avatar. If you already are registered, login to user your nickname.

Yes No

Comment preview

Network Blogo