How to Change PHP Settings of Server

You can change PHP settings for your apps by creating a file named .user.ini in your app's web root directory.

apps/APPNAME/public/.user.ini

Using a .user.ini file is the best and safest way to customize PHP settings for an app. Unlike modifying global configuration files, using a .user.ini file can't break your server.

Format of .user.ini Files

Each line in your .user.ini file should have the format:

key = value

For example, to disable the PHP memory_limit for your app, you'd add the following line to your .user.ini file:

memory_limit = -1

If you've used older hosting where you changed PHP settings through the Apache .htaccess file using the php_flag and php_value directives, you should forget those old habits now. Configuring PHP through .htaccess files does not work when PHP runs through FastCGI via PHP-FPM, such as when using SellCloud.

Verify Changed Settings

To confirm your customizations to your app's .user.ini file are correct, you can create a PHP script that contains only the following line:

<?php phpinfo(); ?>

and then request that file through your browser. You should see the "Local value" for your modified setting showing the value you've set in your .user.ini file.

Alert: For Control Panel Help & Tutorials, click here: Panel Tutorials
  • 0 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

Customizing the PHP Configuration on your Server

Careful! We can't provide support for customizations or for any errors, downtime, or...

Disable the PHP Opcache on your Server

PHP 5.5, 5.6, and 7.0 have a built-in opcache that is enabled by default. The entire purpose of...

How to Change PHP max_execution_time

The PHP setting max_execution_time is the number of seconds PHP will allow a script to run before...

How to Change the PHP Timezone

The default timezone for PHP is UTC regardless of your server's timezone. This is the timezone...

How to Install PHP PECL Extensions

PECL extensions are third-party compiled extensions for PHP. Install the Compiler As PECL...