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
1
vote
1 answer

Yii2: Where is the right place I can add ini_set in my Yii2-advanced-app?

I've an application in my Apache local Server and using Yii2-advanced-app. I need to edit my php.ini to support my project, I need to change precision=14 become precision=20. I'm affraid that change will affect all application in my local server.…
Blackjack
  • 1,016
  • 1
  • 20
  • 51
1
vote
0 answers

PHP showing errors, although display_errors is set to 0

I'm struggling for an hour, trying to figure out why is PHP showing errors although I suppressed them at the very begginging of my code like this: error_reporting(E_ALL); ini_set('log_errors', 1); ini_set('display_errors',…
1
vote
1 answer

ini_set for connected php files advices

In a content management system, a page load usually involves many php files. I'd like to ask to increase the memory_limit or max_execution_time, should i put ini_set on the top of every involving php files, or the first loaded php file is…
aye
  • 301
  • 2
  • 16
1
vote
2 answers

.htaccess :: Cannot set a upload_tmp_dir

Looks like a very simple task but it's not working... I'm trying to set upload_tmp_dir to the ROOT directory on my .htaccess file... php_value upload_tmp_dir / I'm printing out the results and it's stays the same as the default on my php.ini echo…
Steve von Johnson
  • 121
  • 1
  • 1
  • 11
1
vote
0 answers

Internal Server Error with a long executing PHP script

I have one large PHP script, which is built up of separate sections: RSS feed fetching (SimplePie) storing items in MySQL DB check item content for images (checking for img tags with DOMDocument()) generating crops from each image found (using PHP…
rainerbrunotte
  • 907
  • 1
  • 17
  • 37
1
vote
1 answer

Safe to use ini_set in several requests at the same time?

I have a mail script in a php file at my server. The mail script uses the php "mail" function and sets options with ini_set then sends a mail. The script is callable via a http post that sends into the script the options via the body/content and…
fredrik.hjarner
  • 715
  • 8
  • 22
1
vote
1 answer

Set PHP error_handler on server side

We are trying to secure a large application (including some third party applications) and we want to disable anything that would allow programmers or potential hackers to hide errors (that is because we are using some monitoring scripts to check the…
Art
  • 11
  • 2
1
vote
1 answer

CakePHP ini_set on Shared Host

I'm on a shared host and ini_set function is disabled for security reasons. I'm trying to deploy CakePHP 2.4.1 on this host. Fresh cake installation results in a blank page, with no errors shown, instead if I comment these…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
1
vote
0 answers

Using ini_set in PHP file

I just asked this question here regarding sending email from Windows server. Got the answer that the php.ini file has to be configured. After reading a little bit more, I found out about ini_set() function in PHP. So I tried to use it like…
Igal
  • 5,833
  • 20
  • 74
  • 132
1
vote
1 answer

Globally disabled ini_set but Override ini_set for a domain

I have disabled ini_set in PHP. I however want a specific domain to use ini_set. How do I enable ini_set for a specific domain? Thanks
1
vote
1 answer

PHP max exec time ,max upload limit, memory limit etc to unlimited with 0 or -1

Sorry if this type of ques already exists. To set php ini values in script what is the better way for infinity purpose? some people preferred -1 or some 0. What's the best solution? And why? Thanks
Shibly
  • 23
  • 1
  • 7
1
vote
0 answers

Setting mail from using ini_set not working

I have a contact form with email script which worked fine when hosted on a windows server. I recently changed to Linux and now it works, but is ignoring the ini_set command. I have this: ini_set("sendmail_from",'admin@mywebsite.com'); in my code…
Claire
  • 53
  • 6
1
vote
2 answers

Changing upload_max_filesize on a shared webhost? (Apache, PHP)

I want to change upload_max_filesize on my shared webhosting account to something greater than 2M. Since I don't have access to php.ini, and apparently you can't use ini_set to change upload_max_filesize, I don't know what to do. Maybe something…
Zack Burt
  • 8,257
  • 10
  • 53
  • 81
0
votes
0 answers

Which php.ini setting controls the permissions of the php_ini function?

Possible Duplicate: ini_set(“memory_limit”) in PHP 5.3.3 is not working at all I just moved my project to a new server. I set the server up myself (apt-get install apache2 php5 mysql-server was most of that task). My project has a config.php file…
Hubro
  • 56,214
  • 69
  • 228
  • 381
0
votes
1 answer

PHP Glob is taking up a lot of memory whenever searching through massive files

I am trying to open a folder with 9.52GB of files with Glob and search through it, but it seems glob can't handle it all, as this error shows: Fatal error: Allowed memory size of 10484711424 bytes exhausted (tried to allocate 10250972360 bytes) in…
Koen Kre
  • 11
  • 4