Forums »
  Tutorial And Guides Forums And Topics Discussions For Help »
    How To Change Memory Limit Php Apache Server

How To Change Memory Limit Php Apache Server

Description: this is a step by step tutorial guide that will help you change the memory limit settings on your php server to allow more memory on your scripts
Tags: php ,memory , limit
Posted On Fri Jul 21, 2006 By webmaster In Tutorial And Guides Forums And Topics Discussions For Help Forums
In this tutorial, I will show you how to change the memory limit in php. The default memory is set for 8M, but sometimes webmaster and admins need to change this to make their website faster.

WARNING!!
- Always Make a backup file of php.ini before you start to do anythingn like this. If you dont know what you are doing, these changes could make your website go down. Please Read Disclaimer
http://www.webune.com/forums/viewtopic-p-83.html#83

1. If you dont know what your php settings are. See the post on this link;
http://www.webune.com/forums/how-can-do-i-you-create-make-a-phpinfo-php-file-t22.html

2. If your memory is set to 8M, continue with next step

3. Open your php.ini file. If your server is a Webune Dedicated Server with Redhat, Centos or Fedora, you can run the following command to edit the php.ini file:
CODE:
nano /etc/php.ini

If you don't know where your php.ini file is, go back to step 1, the phpinfo.php file will show you where the pnp.ini file is at.

4.
Find
CODE:
memory_limit = 8M  ; Maximum amount of memory a script may consume (8MB)

Replace With
CODE:
memory_limit = 16M  ; Maximum amount of memory a script may consume (8MB)
Basically I changed 8 to 16

5. Save file by hitting Control+x -then you will be asked if you want to save changes, type the letter y for yes

6. Then hit Return at the next prompt.

7. Restart Apache Server with the following command
CODE:
/etc/init.d/httpd restart


NOTE: if you dont access to your server. for example, you have shared hosting, you can just set the configuration using the ini_set('memory_limit', '100m');
for more information about this, see reply #122244 by deter


8. Do step 1 again, and this time your phpinfo.php file should show 16M instead of 8M

9. DONE
suraj Thu Jan 12, 2012
Where i have to give all of the above commands, such as where to give command for restarting server.By the way , i have Apache server...
My admin page show on edit page tab Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 194264 bytes) in /home/tech/publ on line 40 on botttom on wordpress.
joe Tue Jul 20, 2010
Thanx a lot.I was really struggling to solve this problem on several sites that i am working on but now, not a problem any more.I even helped out a friend of mine on the same issue.piece of cake nowthnx
kinder Wed Mar 10, 2010
QUOTE:EQ:
So if I were to set a large memory like 400M would this effect my system in a negative way ?

I want to allow Large uploads of about 200M

-------------
yeah, you better only allow people you trust to do those kinds of uploads.

but generally, you can set it to whatever you want
EQ Thu Feb 18, 2010
So if I were to set a large memory like 400M would this effect my system in a negative way ?

I want to allow Large uploads of about 200M
kit Sun Feb 07, 2010
thanks so much, SO so So very much. This helped me fix a problem with gathering album art in mass for an sql DB of albums.
deter Thu Dec 03, 2009
or you can set the memory limit within a file using ini_set() function:

at ini_set('memory_limit', '100m');
Dangerell Wed Dec 03, 2008
thank you.
wedings Sat Oct 18, 2008
wedings amd nomre
Mr Sun Nov 18, 2007
hi there

great tutorial as i am a beginner, dug me out of a great big hole, i cant thank you enough !

woc
Wrhona Fri Nov 02, 2007
the phpinfo.php don't show up when i did the command and uploaded..what am i missing?
kEpEx Fri Sep 28, 2007
keflog
keflog
kEpEx Fri Sep 28, 2007
the path to the file, to restart apache and the config ini of the php, may change depending of the distributiong...

on debian, the path to restart is: /etc/init.d/apache

keflog /
Hiland Mon Apr 16, 2007
Thanks a lot- this solved my problem
Muslim Wed Jul 11, 2012
Thanks a lot. It is fully worked. I can install typo3 on my local server now.
:-D
Information
Title: How To Change Memory Limit Php Apache Server
Info: This Post Has Been Viewed 0 Times Since
Date: Fri Jul 21, 2006
Author webmaster Received 14 Replies #1398
Related Sites
Add Your Website
Share
wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Wed Jun 19, 2013 (-8 GMT)
Powered by: Webune Forums V5