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.

91 questions
11
votes
8 answers

What are the reasons why PHP would echo errors, even with error_reporting(0)?

What are some reasons why PHP would force errors to show, no matter what you tell it to disable? I have tried error_reporting(0); ini_set('display_errors', 0); with no luck.
Valdemarick
  • 247
  • 2
  • 4
  • 10
8
votes
2 answers

What difference does usage of symbol @ with ini_set, built-in function makes in PHP?

In one of my project's configuration settings I observed following two lines at the beginning of file : @ini_set('memory_limit', '-1'); @set_time_limit(0); My doubt is what's the difference in the above two lines of code and following lines of…
user4225623
7
votes
2 answers

How to override register_argc_argv in PHP?

I'm using a shared host (fasthostingdirect) and for some reason they have this flag turned off by default. This means I'm unable to access PHP command line parameters... unless I use the -n (= --no-php-info) flag after php.exe. Have tried…
Steve Chambers
  • 31,993
  • 15
  • 129
  • 173
7
votes
3 answers

Where to call ini_set() functions in the class?

I wanna know where is the best place to put the ini_set() functions, because I think when the ini_set function is inside the method like this: private function archiveBackup() { ini_set('memory_limit', '128M'); ini_set('max_execution_time',…
user546774
6
votes
4 answers

Strange problem while uploading large files

I am having a strange problem while uploading large files in PHP. In php.ini, max_execution_time is set to 30, post_max_size is set to 32M, upload_max_filesize is set to 32M. When I tried to upload a file of size 40.2 MB, it don't show any error.…
Debiprasad
  • 4,996
  • 11
  • 55
  • 87
6
votes
3 answers

Php CLI script ignoring memory_limit, crashing at much lower number than limit

for some reason, my one of my php scripts are ignoring the php.ini memory limit or ini_set. When i do a print_r(ini_get_all) it shows the global memory limit set to 100M (and local for that matter), when my script dies at Fatal error: Out of memory…
james
  • 3,243
  • 8
  • 28
  • 38
6
votes
2 answers

PHP: mail() function with runtime ini_set() for SMTP and SMTP_PORT not working on Linux

I have used a PHP code for Mailing using a SMTP HOST as given below: ini_set('SMTP','myserver'); ini_set('smtp_port',25); $to = $email; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" .…
Padyster
  • 963
  • 3
  • 11
  • 21
5
votes
5 answers

passing session id via url

I'm trying to get my script to use url session id instead of cookies. The following page is not picking up the variable in the url as the session id. I must be missing something. First page…
None
5
votes
3 answers

PHP - ini_set() expects parameter 2 to be string, integer given

I have this part of code: ... ini_set('max_execution_time', 300); ... Until now it worked. Now i am getting this error: ini_set() expects parameter 2 to be string, integer given What has changed? Can it be caused by PHP version?
MakoBuk
  • 471
  • 1
  • 6
  • 15
5
votes
6 answers

Can't disable error reporting in OpenCart (PHP)

I can't seem to disable error reporting in PHP - I have tried everything but "Notice" errors are still displayed. My php.ini has display_errors = Off; error_reporting = 0; My .htaccess has php_value error_reporting 0 And my script…
colmde
  • 2,852
  • 1
  • 19
  • 42
5
votes
1 answer

ini_set() always returning false

On my current project I have a security.php which holds up, some functions and some ini_set() statements. ini_set('session.use_trans_sid', 0); ini_set('session.use_only_cookies', 1); ini_set('session.cookie_secure',…
Sebastjan
  • 975
  • 2
  • 13
  • 24
4
votes
1 answer

why does the ini_set('memory_limit') doesn't work?

I am doing a file resizer feature, and when I use very high resolution images, I get this fatal error: PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 8884 bytes) in /path/resizer.php on line 35 (resizer.php is…
alexx0186
  • 1,347
  • 5
  • 17
  • 31
4
votes
3 answers

How do I check if ini_set() is enabled either in the global PHP.INI or in my PHP script?

I have an app that is failing on the install. The vendor says I probably have ini_set() disabled. How can I check this?
user4903
4
votes
1 answer

How to change the way PHP writes errors in the error log file?

I have been working on my website for over a year now, and I am very anxious to finally put it out there for people to use. It has gotten quite large however - I almost want to say out of my control - and on top of that I am really just an self…
olli
  • 1,596
  • 3
  • 18
  • 36
4
votes
1 answer

php ini_set() changes don't take with safe mode off

I wanted to turn output buffering off. Currently it shows no value for local and master. I run ini_set('output_buffering',4092); and no changes in phpinfo(). Safe mode is off. What's the next thing to check?
Jared Eitnier
  • 6,482
  • 11
  • 62
  • 118
1
2 3 4 5 6 7