Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Location
    Finland, Hollola
    Posts
    285
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Which ini setting determines if ini_set() is usable?

    Hi,

    If I use ini_set() function is works or not. What php ini settings determines this?

    Thanks!
    PHP 5 & MySQL 5 (Y)

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    It should work out of the box. Please note the following from PHP documentation

    The configuration option will keep this new value during the script's execution, and will be restored at the script's ending

    You can also use .htaccess to set some functionalities on or off for a given folder or for a whole website. for example, in a .htaccess file, you can write the following

    Code:
    PHP_FLAG output_buffering On
    php_value memory_limit "32M"
    php_flag register_globals off
    php_flag magic_quotes_gpc on
    all the best

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Location
    Finland, Hollola
    Posts
    285
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Ah OK. So it will stay until the script ends. Does this always apply?
    PHP 5 & MySQL 5 (Y)

  • #4
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    some php config options take effect before the script is reached, and so these must be set in php.ini or (if apache allows it) in the .htaccess for the location.
    If you take a look at http://uk.php.net/manual/en/ini.php#ini.list it tells you from where each option can be set (the 'changeable' column)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •