tags:

views:

41

answers:

2

I want to change the php setting but from ".php" page not php.ini. The settings I want to change is

upload_max_filesize, post_max_size and memory_limit

+2  A: 

If your server administrator hasn't prevented it, you can use ini_set() to change the memory limit:

ini_set("memory_limit","16000000"); // abbreviations like "16M" work only 
                                    // in php.ini, always use full numbers here

The two other options are needed before the PHP script is loaded, there is no way to change those in php.ini.

Pekka
then how can i change them, my control panel does not give me the option to change php.ini settingsbut i need to upload files larger than 100MB
Starx
@Starx sorry, there is probably no way to do this if you don't have access to `php.ini`. You'll have to talk to your provider or server administrator and ask them to increase the limit for you.
Pekka
+3  A: 

You can try it with a .htaccess file, if you have AllowOverride Options:

Place a file named .htaccess to your webroot:

php_value upload_max_filesize 10000
php_value post_max_size 10000
php_value memory_limit 10000
WishCow
Hah! Forgot this possibility. Not always available either in shared hosting, but worth a try. +1
Pekka
can you please tell me where to put this .htaccess. I mean you webroot, but confused in public_html\ or www\ or on the folder executing the script like public_html\uploads\
Starx
You can place it in any folder below the webroot. Put it next to your index.php file and it should work.
WishCow