Happy New Year 2014 to all the readers!!
Its been quite some time I wrote a blog post. I am back and today I will be writing a small post on the importance of .user.ini file w.r.t Windows Azure Web Sites (WAWS)
As you know WAWS supports PHP framework. As of today it supports the following versions of the framework:
Go to the CONFIGURE page under your WAWS site to configure this setting. As seen in the above image the user can choose any one of the framework versions which are supported by WAWS.
You can check the PHP runtime configuration by adding a sample php page to your WAWS site with the following one line of code:
PHP picks up its configuration from the file php.ini when it starts up. If you access the above page for your site, you will see that this file resides under: C:\DWASFiles\Sites\<SiteName>\Config\PHP-5.5.3\php.ini
You can read more PHP.ini here:
On premise, the server admins would modify the contents of this file to configure the PHP runtime to tailor to the needs of the application.
On WAWS, with the default runtime versions that are provided the users cannot modify the contents of the php.ini file, so there is hardly any room for customization of PHP runtime configuration. However, the users aren’t completely helpless here. There is another configuration file, .user.ini.
Support for these files were included in PHP Version 5.3.0 as they added support for configuration INI files on a per-directory basis. You can read more about it here: .user.ini files.
So we can use the above file to customize/override the PHP runtime settings with the modes PHP_INI_PERDIR and PHP_INI_USER. List of php.ini directives is available here: http://www.php.net/manual/en/ini.list.php
So the question remains where do we place this .user.ini file? On WAWS the recommended place is to place this file in the root of the website which is wwwroot folder.
I will write further posts on how to take advantage of the .user.ini configuration file. Until then CIAO