ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of the
script that contains that ini_set().
And that is good. If everybody (on a shared hosting environment) could
change the real php.ini (by using ini_set), development would become very
troublesome because php.ini changes a lot. :-)
Regards,
Erwin Moller
PS: Overwriting short_open_tags is not very usefull, since this setting
should be known by PHP before parsing the php-file.
It is better to ALWAYS use <?php instead of relying on short open tags.
>
Hi,
>
ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of the
script that contains that ini_set().
>
well, how do I know which value in php.ini can be changed, and which
not?
>
Hi,
>
ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of the
script that contains that ini_set().
>
well, how do I know which value in php.ini can be changed, and which
not?
>>
>Hi,
>>
>ini_set() doesn't change the settings in php.ini.
>It just (tries) to overwrite some value in php.ini for the duration of
>the script that contains that ini_set().
>>
>
well, how do I know which value in php.ini can be changed, and which
not?
>
seems can't find on the php.com
And always test.
If you change some ini value, simply check inyour srcipt if it changed
succesfully.
It is considered (by me) good programming practice to have a file included
above all scripts (or at least the entrypoints of your site).
In this file you check a few thing that are important to the functioning of
your application.
Eg: are magic quotes on? Can you change the include-directory? etc.
Fail if some assumptions are not met with a clear complaint (eg: This
application needs mysqli to run, not mysql! mysqli not found.).
This has the advantage that when you change ISP or update your server, or
change to a newer version of PHP, your scripts will fail with a clear
complaint instead of failing in unpredicted ways.
Note: Some of these settings can NOT be changed when running in save mode.
still showing 'off'
>
Hi,
>
ini_set() doesn't change the settings in php.ini.
It just (tries) to overwrite some value in php.ini for the duration of
the script that contains that ini_set().
>
well, how do I know which value in php.ini can be changed, and which
not?
>
Pay attention to the column named 'changable'.
>
And always test.
If you change some ini value, simply check inyour srcipt if it changed
succesfully.
>
It is considered (by me) good programming practice to have a file included
above all scripts (or at least the entrypoints of your site).
In this file you check a few thing that are important to the functioning of
your application.
Eg: are magic quotes on? Can you change the include-directory? etc.
Fail if some assumptions are not met with a clear complaint (eg: This
application needs mysqli to run, not mysql! mysqli not found.).
>
This has the advantage that when you change ISP or update your server, or
change to a newer version of PHP, your scripts will fail with a clear
complaint instead of failing in unpredicted ways.
Note: Some of these settings can NOT be changed when running in save mode.
Comment