How To Change Memory Limit PHP Apache Server

Mobile
feeds
Welcome Login | Register

How To Change Memory Limit PHP Apache Server
Reply Your Comments:
Click this button if you are interested in replying to this topic and leave your comments
Sent To Friend
CLick this button if you want to send this page to a friend.
Subsribe To Rss Feeds
Subscribe to RSS
CLick this button if you want to subscribe to this RSS Feed. You can use your browsers feeds burners if you have mozilla or internet explorer 7 or higher and keep up with updates.
  Forums Index
      » Tutorial and Guides Forums
        » » How To Change Memory Limit PHP Apache Server
How To Change Memory Limit PHP Apache Server
Post Description: how to change memory limit php apache server Tutorial and Guides
Post Tags:
This Post Has Been Viewed 16375 Times Since Fri Jul 21, 2006 9:12 am Author webmaster with 11 replies
Next Post »» Disclaimer - Read Me First
How To Change Memory Limit PHP Apache Server
Advertise On This Page




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


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

9. DONE


Leave Your Comments

Your Name
Your Email Address (Will Not Be Published)
Notify Me When Someone Replies to this Page
(An email will be sent to you when someone replies to your comments)
Your Comments
Include A Picture with your comments
Share
| More
Share this page by putting this URL in your comments to other websites like myspace, Facebook, Twitter friendster, Hi5, Groups, Boards, Forum or others. Just Copy and Paste this Code
URL:
To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it.
Embed:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
BBCODE:
Subscribe Feeds
Webmasters - Exchange Links With Us. Add related websites to this topic
Add Link:
Links Related to : How To Change Memory Limit PHP Apache Server

Comments and replies About How To Change Memory Limit PHP Apache Server
:: 1 :: Reply #1565 Reply By Hiland On Mon Apr 16, 2007 7:02 am
Hiland:
Thanks a lot- this solved my problem
:: 2 :: Reply #22050 Reply By kEpEx On Fri Sep 28, 2007 6:13 am
kEpEx:
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 /
:: 3 :: Reply #22051 Reply By kEpEx On Fri Sep 28, 2007 6:19 am
kEpEx:
keflog
keflog
:: 4 :: Reply #26349 Reply By Wrhona On Fri Nov 02, 2007 9:57 am
Wrhona:
the phpinfo.php don't show up when i did the command and uploaded..what am i missing?
:: 5 :: Reply #28142 Reply By Mr On Sun Nov 18, 2007 6:02 am
Mr:
hi there

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

woc
:: 6 :: Reply #76071 Reply By wedings On Sat Oct 18, 2008 11:51 am
wedings:
wedings amd nomre
:: 7 :: Reply #84504 Reply By Dangerell On Wed Dec 03, 2008 5:34 am
Dangerell:
thank you.
:: 8 :: Reply #122244 Reply By deter On Thu Dec 03, 2009 1:09 am
deter:
or you can set the memory limit within a file using ini_set() function:

at ini_set('memory_limit', '100m');
:: 9 :: Reply #127556 Reply By kit On Sun Feb 07, 2010 2:57 am
kit:
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.
:: 10 :: Reply #128428 Reply By EQ On Thu Feb 18, 2010 1:02 am
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
:: 11 :: Reply #129712 Reply By kinder On Wed Mar 10, 2010 10:40 pm
kinder:
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