Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
July 31, 2010, 09:24:11 PM

Pages: [1]   Go Down
  Print  
Author Topic: max image size and max post size  (Read 685 times)
durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« on: January 30, 2010, 09:58:49 PM »

two areas i have questions, first is both (mis)max image size and (mps)max post size,  here is my current htaccess

Code:
# default memory limit to 64Mb
php_value memory_limit 64M
# to make sure register global is off
php_value register_globals 0
# max post size to 12Mb was 8 and 8388608
php_value post_max_size 12582912
# upload size limit to 6Mb was 5 5242880
php_value upload_max_filesize 6291456
 

as you can see i went in and added just a bit to it because my domain is tugging a bit..
i would like to make it 15mb post and 7mb upload if i could... now here is the second part...

i dont know how, this change is not affecting anything on my site that i can see and so do i have to add something to the php.ini as well, my ini has nothing in there regarding image sizes or the like, so not sure what yo do or how. thanks.
Logged
DEddleman
Spacescooter Operator
*****
Offline Offline

Posts: 34


Elite!


« Reply #1 on: January 31, 2010, 05:44:31 AM »

Those changes will have to be made in php.ini. The options are in there, especially max_size and upload_max_filesize. The options are set in there as the same as you're attempting to set them in your .htaccess.
Logged

wektech
Jedi
*****
Offline Offline

Posts: 941



WWW
« Reply #2 on: January 31, 2010, 06:06:48 AM »

I altered the defaults by adding:
Code:
suPHP_ConfigPath /home/xxxxx4/public_html
to the .htaccess file to tell suphp where the php.ini file is located. I then added
Code:
upload_max_filesize = 5M
post_max_size = 6M
to the php.ini file to increase the filesize allowed.
Logged

durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #3 on: January 31, 2010, 07:11:12 AM »

but it should be the number of bytes right not just 5M, i think  you have to spell it out in bytes right like i did in the htaccess ?

well i changed both and no affect at all..

htaccess
<IfModule mod_php5.c>
suPHP_ConfigPath /home/xxxxxxxx/public_html
   # default memory limit to 64Mb
   php_value memory_limit 64M
   # to make sure register global is off
   php_value register_globals 0
   # max post size to 12Mb was 8 and 8388608
   php_value post_max_size 12582912
   # upload size limit to 6Mb was 5 5242880   
   php_value upload_max_filesize 6291456

php ini

php_value post_max_size 12582912
php_value upload_max_filesize 6291456


no change at all, still shows same old settings
« Last Edit: January 31, 2010, 07:18:28 AM by durangod » Logged
MrPhil
Professor in Nanotechnology
*****
Offline Offline

Posts: 4760



« Reply #4 on: January 31, 2010, 07:32:31 AM »

Do not put php_value and php_flag entries in .htaccess. They must be moved to php.ini with the appropriate syntax change:
.htaccess
Code:
suPHP_ConfigPath /home/xxxxxx/public_html
(or wherever your php.ini lives).

php.ini
Code:
# default memory limit to 64Mb
   memory_limit=64M
   # to make sure register global is off
   register_globals=off
   # max post size to 12Mb was 8 and 8388608
   post_max_size=12582912
   # upload size limit to 6Mb was 5 5242880   
   upload_max_filesize=6291456

Run the following script before and after creating php.ini, to confirm that it's being processed correctly:
Code:
<?php phpinfo(); ?>
Logged

durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #5 on: January 31, 2010, 08:28:59 AM »

took this out of htaccess and put it into php init just as it is, just to clarify this is no longer in my htaccess at all

    # default memory limit to 64Mb
   memory_limit=64M
   # to make sure register global is off
   register_globals=off
   # max post size to 12Mb was 8 and 8388608
   post_max_size=12582912
   # upload size limit to 6Mb was 5 5242880  
   upload_max_filesize=6291456

and put this in my htaccess inside that sub directory..


suPHP_ConfigPath /home/xxxxxx/public_html      and of course the x now have my dir in there not the x

ran php info, no change, not working

« Last Edit: January 31, 2010, 08:36:03 AM by durangod » Logged
durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #6 on: January 31, 2010, 09:05:48 AM »

hope this helps others, here is the answer i got from tech support..

Because we use suPHP to parse php files, you have the option of using a custom php.ini file.

Your account can have multiple php.ini files on your account in different folders so you can customize the php processing in different folders should your script require it. A php.ini file will not inherit down into subfolders, however, you can create a .htaccess file in the same folder as the php.ini file and place the following code into it:

suPHP_ConfigPath /home/username/public_html/

where "username" is your cPanel username. This will cause the php.ini file to affect all subfolders, unless a php.ini file is in a subfolder, at which point the php.ini in the subfolder takes precedence.

In php.ini, you will need to use the actual php.ini syntax instead of the php_value or php_flag syntax you would normally use in .htaccess (Which should not be used at all):

setting_name = setting_value

So, this means if you move the settings from .htaccess to php.ini, you must convert the format. Let's say you have the following line in your .htaccess file:

php_value register_globals 0

the corresponding php.ini format is as follows:

register_globals = Off

Notice how the value 0 becomes Off and 1 becomes On. Now if your php_value has quotes like the following, for example:

php_value include_path ".:/home/user/lib"

The corresponding php.ini format is:

include_path = ".:/home/user/lib"

and so on. You should only use the settings you need to change in your php.ini.

For the PHP settings you do not have in your php.ini file, PHP will use our default configurations.

Logged
MrPhil
Professor in Nanotechnology
*****
Offline Offline

Posts: 4760



« Reply #7 on: January 31, 2010, 09:09:47 AM »

You have the file /home/xxxxx/public_html/php.ini, and it's not being processed, according to phpinfo()? If php.ini is elsewhere (such as in a subdirectory) you obviously have to give the correct path to it. You can try 5000000 instead of 5M -- it shouldn't hurt anything. Do you see in phpinfo() that nothing in php.ini is being applied, or just some items?
Logged

durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #8 on: January 31, 2010, 09:28:53 AM »

ok thanks bud, now going straight from their reply, this is what i have done and its still not working

i my root dir there is a php ini right,  ok not worried about that one, as per their reply i can put my own ini file in my sub dir if i want to, so that is what i did...

in my sub domain directory  i now have its own  php ini with the following (i hope i converted that htaccess code correctly)


memory_limit = 164MB
Register_globals= Off
post_max_size = 15MB
upload_max_filesize = 10MB
display_errors = Off

now im assuming that when i load that site page that it hits the sub dir php ini by default.   but just in case i put the following in my htaccess that is in the sub folder as a backup link


suPHP_ConfigPath /home/username/public_html/subfoldername/

and its still not working    
« Last Edit: January 31, 2010, 09:31:59 AM by durangod » Logged
durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #9 on: January 31, 2010, 09:38:24 AM »

had to remove that structure above because site went down omg lmao i just wanaa change the mem size omg is this gonna be another all day process, why do difficult, lp should have a widget for this crap ya know..
Logged
durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #10 on: January 31, 2010, 09:49:52 AM »

ok so lets take this one step at a time here, since my site is a sub domain it has a sub folder in that sub folder has an htaccess file, the very first line of that file now reads,

suPHP_ConfigPath /home/xxxxxxxxx/public_html/          x is my username

now when i load the site that tells the htaccess to look in the root directory for the php ini settings right...

now then

in my root directory in that php ini i have all the defaut zend stuff from lp at the top and under that i have


memory_limit = 164MB
post_max_size = 15MB
upload_max_filesize = 10MB
display_errors = Off
    

so it should work  but its not
« Last Edit: January 31, 2010, 10:02:29 AM by durangod » Logged
durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #11 on: January 31, 2010, 09:57:20 AM »

ok  so i was running the php my info from the sub dir, because thats where i need it to affect, i have a stat program in that software thats lets me know and its not changing...  so thats why i was running the info in the sub dir

now when i run the info in the root dir it works..


does that also affect the sub dir even when it does not show up in the stat software or the php info in the sub

does that make sense

and with the setup with the sub pointing to the ini in root the site goes down totally
« Last Edit: January 31, 2010, 09:59:44 AM by durangod » Logged
durangod
Intergalactic Superstar
*****
Offline Offline

Posts: 180


« Reply #12 on: January 31, 2010, 10:36:28 AM »

ok got it!!!    Bouncin for Joy Bouncin for Joy     Thumbs Up

here is the deal

this goes in the phpini in the root   (you have to use M not MB

memory_limit = 164M
post_max_size = 15M
upload_max_filesize = 10M
display_errors = Off

Once the above has been completed, you will also need to add the following line to your .htaccess file (also located in the public_html directory):

this was my mistake because i kept adding this to the htaccess in the sub folder not the root...

suPHP_ConfigPath /home/username/public_html

where "username" is your cPanel username. This will cause the php.ini file to effect all subfolders, unless a php.ini file is in a subfolder, at which point the php.ini in the subfolder takes precedence.


works perfect!!!!    hope this helps someone

Logged
Pages: [1]   Go Up
  Print  
 
Jump to: