Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are duplicate directives in php.ini going to cause an issue?

Tags:

php

I sent a request to ops today to update some php.ini directives, and found out that he merely appended them to the end of the file. My google search didn't really come up with any info on whether this is a problem or not to have duplicates in there and how they would be parsed. Obviously, it can cause confusion, but, I would have a stronger argument if I knew if this was acceptable or not.

Any input?

Thanks in advance...

like image 394
Brandon G Avatar asked Jan 10 '11 21:01

Brandon G


People also ask

What does PHP ini contain?

The php. ini file contains all of the current PHP configuration settings: such as the execution time, memory limit, etc. This is also how PECL modules are enabled such as memcache, APC, etc. This file allows you to override the server's default configuration settings.

What is the directive that is used to enable/disable file uploading in the PHP ini file?

You can use the expose_php directive in a custom php. ini file to control whether or not PHP sends version information in the HTTP headers. Learn more here.


2 Answers

The last mentioned value takes precedence.

memory_limit = 32M

... # more directives

memory_limit = 128M

<EOF>

Makes the memory_limit be 128M.

like image 90
Linus Kleen Avatar answered Oct 13 '22 23:10

Linus Kleen


It is usually not a crisis if something is declared twice. The normal behaviour would then be to use the last value parsed.

like image 37
xaoax Avatar answered Oct 14 '22 00:10

xaoax