Let's said that I have installed PHP 5.5.x in Ubuntu and it comes with a default configuration. I would like to overwrite a few configurations but I do not want to (this is how I know it's possible):
- edit the default
php.ini
file - use a PHP block in each
.php
file to overwrite them - use
.htaccess
files and directives
I would like to create a file named custom-php.ini
with the following lines (as an example):
; Basic configuration override
expose_php = Off
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M
date.timezone = UTC
max_execution_time = 120
; Error reporting
display_errors = stderr
display_startup_errors = Off
error_reporting = E_ALL
; A bit of performance tuning
realpath_cache_size = 128k
; OpCache tuning
opcache.max_accelerated_files = 32000
; Temporarily disable using HUGE PAGES by OpCache.
; This should improve performance, but requires appropriate OS configuration
; and for now it often results with some weird PHP warning:
; PHP Warning: Zend OPcache huge_code_pages: madvise(HUGEPAGE) failed: Invalid argument (22) in Unknown on line 0
opcache.huge_code_pages=0
; Xdebug
[Xdebug]
xdebug.remote_enable = true
xdebug.remote_host = "192.168.3.1" // this IP should be the host IP
xdebug.remote_port = "9001"
xdebug.idekey = "XDEBUG_PHPSTORM"
Is there any place where I can write this file and default PHP values gets overwrited by the ones on custom-php.ini
?