Where do i change the memory limit on this php script?

hell0

BANNED
Aug 6, 2008
202
111
View attachment php file.zip

I was running this script,its a comment submitter from the forum


while running,it said memory of x bytes exceecded for .php

the line i am looking for is:

something like ...

memory_limit = 16M

i want to change it to something like ...

memory_limit = 10000000M

though i used the search function,couldnt find it in the file

do I need a different file to edit?
 
The memory limit for php is defined by the servers "php.ini" file. If you are not running a VPS (Virtual Private Server) or a Dedicated Server you probably dont have access to edit the php.ini file.

If you do have access to edit the php.ini file it typically must be done from the shell, you will need a application such as "putty" to connect to the command prompt of the server on a root level.

I will not go into details on how to edit the php.ini file, because honestly if you are unsure of how to access the shell and the php.ini file, then you should probably not be touching it. Ask your hosting provider to make this change.

If you are on a shared hosting environment and do not have access to php.ini you can try adding the following line to your root .htaccess file:

php_value memory_limit 24M

Change the "24M" to the memory limit you would like...

However, if a script is timing out due to using all the memory there is typically a problem with the script itself. I would be hesitant about allowing PHP to use 10000000M of memory to run a script.

If you would like to know more details about why its a bad ideato make the memory limit that high, please do not hesitate to ask.
 
drdankmendez got you right on with the php memory limit in your .htaccess file. Even though most of my sites are on a VPS, I use that method anyway so I can control it on a per site basis. Another thing you may consider adding since you are running into limits is up the maximum execution time too. The number is the time in seconds. You can also add it to your .htaccess file in most cases:
Code:
php_value memory_limit 24M
php_value max_execution_time 60
 
ok thanks guys,will forward the thread to someone who might understand a bit more :)

as i dont have the ht access file
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock