How to overwrite some PHP configuration defaults with a custom .ini file?
<p>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):</p>

<ul>
<li>edit the default <code>php.ini</code> file</li>
<li>use a PHP block in each <code>.php</code> file to overwrite them</li>
<li>use <code>.htaccess</code> files and directives</li>
</ul>

<p>I would like to create a file named <code>custom-php.ini</code> with the following lines (as an example):</p>

<pre><code>; 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"
</code></pre>

<p>Is there any place where I can write this file and default PHP values gets overwrited by the ones on <code>custom-php.ini</code>? </p>