Skip to content

How to Configure Key PHP Parameters

The PHP configuration file (php.ini) contains dozens of parameters that define the behavior of the PHP interpreter. Properly adjusting these settings can significantly improve your website’s security, performance, and stability.

To modify the settings, go to the PHP section in the BeAdmin control panel and select the desired PHP version. The configuration file will open automatically and be available for editing in a convenient interface.

Once you’ve made the necessary changes, click Save. The updated parameters will be applied to the selected PHP interpreter and used by all associated websites.

💡 Tip

Use keyboard shortcuts to quickly search for specific parameters in the browser:

  • Ctrl + F — on Windows/Linux
  • Cmd + F — on macOS

1. memory_limit

Limits the maximum amount of memory a script is allowed to use.

Common values:

  • 128M — suitable for most websites.
  • 256M — ideal for CMS platforms with plugins (e.g., WordPress + WooCommerce).
  • 512M — for resource-heavy applications (Laravel, Magento).

2. upload_max_filesize

Sets the maximum size of a file that can be uploaded via a form.

Common values:

  • 2M — default value.
  • 10M — for images and documents.
  • 100M — for video files and archives.

3. post_max_size

Defines the maximum amount of data that can be sent via POST.

Common values:

  • 8M — minimal safe limit.
  • 20M — for uploading images.
  • 120M — for large forms or multimedia content.

📌 Important

The value should be equal to or greater than upload_max_filesize.

4. max_execution_time

Limits how long a PHP script is allowed to run (in seconds).

Common values:

  • 30 — default value.
  • 60 — for database queries and uploads.
  • 300 — for backups and large imports.

5. max_input_time

Limits the time available to parse input data (POST, GET, FILES).

Common values:

  • 60 — default.
  • 120 — for slow connections or large uploads.

6. display_errors

Controls whether errors are displayed on the screen.

Common values:

  • On — useful for development.
  • Off — safer for production environments.

7. log_errors

Enables error logging to a file.

Common values:

  • On — recommended for all environments.
  • Off — disables logging (not recommended).

💡 Tip

Set a custom log path with error_log = /var/log/php_errors.log.

8. short_open_tag

Enables or disables short PHP opening tags <?.

Common values:

  • On — for legacy scripts.
  • Off — safer; use <?php instead.

9. date.timezone

Sets the default timezone for date/time functions.

Common values:

  • UTC
  • America/New_York
  • Europe/London

⚠️ Important

If not set, PHP may throw timezone-related warnings.

10. session.gc_maxlifetime

Defines how long (in seconds) a user session remains active.

Common values:

  • 1440 — default (24 minutes).
  • 3600 — one hour.
  • 86400 — one day.

Conclusion

Proper PHP configuration is a crucial step in maintaining a secure and stable website. Use the above parameters as a baseline and adjust them according to the specific needs of your project.

BeAdmin © 2025. All rights reserved.