Questions tagged [ini-set]

The ini_set() function is used to set PHP configuration options at runtime.

ini_set is a PHP function that allows developers to set a configuration option at runtime. This is done by calling the function in any PHP script with the option name ($varname) and the value ($newvalue) to be set:

ini_set ( string $varname , string $newvalue ) : string

If the execution is successful the function returns the previously set value, otherwise it returns false. At the end of the script execution the previous value will be restored automatically.

The option name must contain a valid configuration option name. A full list of names including their default values can be found in the List of php.ini directives in the PHP Manual. Only options with the modes PHP_INI_USER or PHP_INI_ALL can be changed with ini_set(). All other options require to be changed by editing php.ini.

92 questions
2
votes
1 answer

date format timezone issue

I'm attempting to set a static time zone to a date for HST (Hawaii time) so no matter where you are in the world it shows the time in Hawaii. Here is my code. ini_set('date.timezone', 'Pacific/Honolulu'); echo date("m/d/Y g:i a"); echos out…
Dom
  • 858
  • 2
  • 11
  • 30
2
votes
1 answer

ini_set('post_max_size', '200M') did not work in php 5.4

ini_set('post_max_size', '200M') did not work in php 5.4 i had use following method. .htaccess , user.ini , php.ini , php5.ini but it did not effect of post_max_size. it remain on 64M. it change the memory limit and execution time but did not…
2
votes
0 answers

Session cookie transfter between subdomains

I have tried all techniques and nothing is working for me. I'm trying to transfer session cookies between subdomains for that mastering website and it's not working. PAGE #1 (test.php on the root of the…
masteringprojects
  • 143
  • 1
  • 2
  • 6
2
votes
3 answers

Which is better php.ini vs ini_set()

I have a simple question, should I write setting or php.ini file or use ini_set() on php file. Which is better regarding the performance? Thank you very much.
Micah
  • 4,254
  • 8
  • 30
  • 38
2
votes
1 answer

ini_set('mbstring.internal_encoding','UTF-8')

ini_set('mbstring.internal_encoding','UTF-8') what does this signify at the beginning of a php file and what is it used for ? I know that a php manual exists but it does not explain it in plain common man's language.
Rahina Rakhi
  • 111
  • 2
  • 11
2
votes
1 answer

Can't access $_SESSION after ini_set

since I have change some settings with ini_set I can't access to the sessions information anymore, but they exist and are correct. These are the setting: ini_set('session.save_path', '../php/config/session'); ini_set('session.hash_function',…
Razorphyn
  • 1,314
  • 13
  • 37
2
votes
2 answers

why ini_set('session.gc_maxlifetime',60) doesn't work?

the default expire time of session is 1440,i want to reduce this time to 60 second,but when i use ini_set('session.gc_maxlifetime','60') in the first page it work,but it doesn't work in an other page, please tell me what is my wrong? …
1
vote
0 answers

error_log reports not showing in specified path

I have this debug function to show runtime errors and some messages. /** * Debug logs * @param string $msg Log message */ function logMsg(?string $msg) { error_reporting(E_ALL); ini_set('ignore_repeated_errors', true); …
abendevs
  • 136
  • 1
  • 11
1
vote
1 answer

using ini_set in php to enable zip decompression

Can't find anything on this one. I have a zip file on my server that doesn't openly support the zip_*() functions. DreamHost's support staff has said that I can modify the php.ini file to allow these… but I was wondering if there's just a ini_set()…
Joel Hackney
  • 147
  • 1
  • 5
  • 13
1
vote
1 answer

Uploading two files on one form?

Ok so i have the form setup perfect but only the first upload is coming through. When i debug the PHP $_FILES i get this Array ( [download] => Array ( [name] => Array ( [0] => 01 something.mp3 [1] => 12 Alone.mp3 ) …
Matt Elhotiby
  • 43,028
  • 85
  • 218
  • 321
1
vote
2 answers

How to set up a secure PHP environment on a wide base of PHP configurations

I'm just finishing a CMS that I want to release as open source. The program has some ini_set() directives to set a secure environment, like session.use_only_cookies, etc. The problem is that some hosts don't allow ini_set() and only allow…
wowpatrick
  • 5,082
  • 15
  • 55
  • 86
1
vote
3 answers

PHP Multi-Domain Sessions; ini_set Not Working?

I'm trying to set it up so if you log in to my website the session carries over to all sub-domains of my website. For example, if you go to domain.com and log in, then go to sub.domain.com, you'll already be logged in at sub.domain.com. To my…
SumWon
  • 65
  • 1
  • 2
  • 7
1
vote
0 answers

ini_set for max_execution_time is not working

I'm using Command line of PHP with Yii Framework Command. As I know on cli default value is 0 When I changed its value to 2 sec, it's giving 0 value that is success value as old value. I also checked value after changing…
Ahmad Asjad
  • 825
  • 1
  • 8
  • 29
1
vote
1 answer

Issues while using ini_set('memory_limit', '-1')

I would like to know, is there any issues(bad to server) while using ini_set('memory_limit', '-1') on number of occasions? The reason why I need to know this is, I'm now working in a project where use of join queries is high. We are only fetch…
Sinto
  • 3,915
  • 11
  • 36
  • 70
1
vote
0 answers

Max execution time when including other files

I have a php file, a.php, that includes b.php, that includes c.php. So a.php looks like this: and b.php looks like this: When I run a.php I get this error: Fatal…
Andri
  • 453
  • 4
  • 22