Raiyu
Raiyu

Reputation: 101

How to change values in php.ini using php application

Just a quick question. Is there a way to change values in the php.ini using codes on the php page so that the values only change for the particular page?

Upvotes: 0

Views: 2980

Answers (3)

Murtadha S.
Murtadha S.

Reputation: 471

You can use the function ini_set to do so.

Upvotes: 1

user9300102
user9300102

Reputation:

You should change that in .htaccess file

php_value upload_max_filesize 20M
php_value post_max_size 20M

http://php.net/manual/en/ini.list.php

PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or .user.ini (since PHP 5.3)

Upvotes: 1

cn0047
cn0047

Reputation: 17091

Yes, it's possible just use function ini_set, like:

ini_set('display_errors', 1);

Upvotes: 4

Related Questions