tags:

views:

38

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: 

The only one of those that can be changed from within PHP is the last one, which can be changed with ini_set like this:

ini_set('memory_limit', '32M');

PHP always processes the client request before the PHP script is started. This means that uploaded files are already uploaded and posted forms are already fully posted beforeb he script starts. The upload and post settings can therefore not be set in the script, ebcause they are already irrelevant when the PHP script is started.

Emil Vikström
And the file uploads will probably be limited by the webserver config too.
symcbean
A: 

Use

ini_set ('key', 'value');

Note that not all the available options can be changed using ini_set(). Here'is a list: ini.list

Read more in ini_set reference;

Andrius