php.ini

php.ini can be used to override most php settings. (examples: maximum upload size, register globals, etc).

php.ini can be created with any text editor (like notepad, or the file manager).

You have to include every setting, not just the settings you want to change from the PHP default, and you must include your new php.ini file in every directory you want the new settings to apply to (where you have PHP files executing from).

If you want to see what the current settings are go to the php Info link from netadmin/cpanel.

the format is:
register_globals = off
session.use_trans_sid = 0
upload_max_filesize = 10M


(insert php settings file here}

Upload that to the top directory you want to have those settings. To verify, create a small php file in that same directory foo.php:
<?PHP
 phpInfo();
?>


Note, the new php.ini must be put in each individual directory you want the overridden settings to apply to. php.ini changes are not recursive (meaning they don't apply to each subdirectory below the directory in which the file is placed.)

Search:

Back:
MysticServer
Comments [Hide comments/form]
This statement in the php.ini topic is not true:

"You do not have to include every setting, just the settings you want to change."

PHP will only process the last php.ini file it sees. So you will lose all the site5 modifications if you only put in what you want to change.

Well, I guess it is true that you don't HAVE to include everything, but you will not get the results you want if you don't.
-- 251-18.26-24.se.res.rr.com (2005-06-05 16:17:26)
Im going to do some testing on this, and edit accordingly.

-Jason
-- JasonR (2005-06-07 08:20:04)
Confirmed. Also checked ini_set doesn't work for any setting I tried.

-Jason
-- JasonR (2005-06-07 08:56:31)
I edited the page to state you must include all settings, as I just lost an hour trying to figure out what was wrong!
-- vdp5126.ath01.dsl.hol.gr (2005-06-14 12:45:48)
There is an easy way to create a custom php.ini file:
http://tips-scripts.com/?tip=php_ini#tip

And an easy way to put it in all your directories (and update them all later as well):
http://tips-scripts.com/?tip=php_ini_copy#tip
-- JasonR (2006-08-09 08:19:09)
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki