You can use a .user.ini file with your PHP application to configure PHP settings such as the amount of data that can be uploaded, displaying verbose errors, increasing memory limits, and many other configurations. A .user.ini file needs to be in the root of the application or website with the settings configured you wish to change.
This article covers several steps for configuring your PHP environment using
.user.ini. The steps are:
.user.ini file including the first period. Add the settings you want to change to the file using the same syntax as a php.ini.
Upload it to the root of your application or website. This is commonly the /site/wwwroot/ directory.
Restart your CloudSite from the control panel. This forces the CloudSite to pull the new settings.
; Example Settings error_reporting = E_ALL & ~E_DEPRECATED display_errors = On display_startup_errors = On
This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a CloudSite.
memory_limit = 256M
The maximum size of an uploaded file, this may required if you want to upload larger images or attachments.
upload_max_filesize = 50M
This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser.
This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET.
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.
Tip: You can create a PHP info page to view your current PHP values. We provide a guide on how to do that included here.
Want to edit or suggest changes to this content? You can edit and submit changes to this article using GitHub.