Get 30% off your WordPress Hosting with code WPSAVE10. Launch Faster. Save More!
  • 00 Days
  • 00 Hours
  • 00 Minutes
  • 00 Seconds

How to change php.ini settings – Enhance Hosting

To change your PHP directives on a single website:

  • On the website dashboard select the advanced drop-down menu
  • Click Developer Tools and scroll to php.ini editor
  • In the directive box put the desired name, select Value and input your desired value in the Text field
  • Click Create to finish

en-php-directive-1024x542.png

PHP directives are used to configure various aspects of PHP’s behaviour. When hosting websites, adjusting these directives can optimise performance, enhance security, and tailor the PHP environment to specific needs. Here’s a list of common PHP directives that you might consider changing for website hosting:

  1. memory_limit: Specifies the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts from eating up all available memory on a server.
  2. upload_max_filesize: Determines the maximum size of an uploaded file. This is crucial for sites that allow users to upload files.
  3. post_max_size: Sets the 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.
  4. max_execution_time: Specifies the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent scripts from tying up the server.
  5. max_input_time: Sets the maximum time in seconds a script is allowed to parse input data, like POST, GET, and file uploads.
  6. display_errors: Determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. It’s often set to “Off” in production environments for security reasons.
  7. error_reporting: Specifies which errors are reported. In development, you might want to see all errors by using E_ALL. In production, you might suppress warnings by setting it to a lower level or even 0 to turn off error reporting.
  8. file_uploads: Enables or disables file upload support in PHP.
  9. allow_url_fopen: Allows PHP’s file functions to retrieve data from remote locations, like FTP or HTTP. This can be a security risk, so some hosts disable it.
  10. short_open_tag: Determines whether PHP will recognize code between <? and ?> tags as PHP code. It’s generally recommended to use the full <?php tag.
  11. session.gc_maxlifetime: Defines the number of seconds after which data will be seen as ‘garbage’ and potentially cleaned up. This affects how long session data is stored.
  12. session.cookie_secure: Specifies whether cookies should only be sent over secure connections. This is an important setting for securing session cookies when using HTTPS.
  13. session.cookie_httponly: Marks the cookie as accessible only through the HTTP protocol. This can help reduce identity theft through XSS attacks.
  14. date.timezone: Sets the default timezone used by all date/time functions in a script.

Adjusting these directives can significantly impact your website’s performance, security, and functionality. Always test changes in a development environment before applying them to your production server to ensure they don’t adversely affect your website.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to disable PHP error reporting – Enhance Hosting

In this guide, we will learn how to hide or suppress PHP errors and notices such as the common...

How to manage DNS – Enhance Hosting

How to add or edit DNS To add or edit DNS entries: Open Websites in the left sidebar Select...

Add a Staging Site & Push Live – Enhance Hosting

To add a staging website Open Websites in the left sidebar Click Add new Select either Start...

Importing a cPanel backup – Enhance Hosting

The cPanel importer allows you to migrate a cPanel account into your website. To import a...

How to manage FTP accounts – Enhance Hosting

To add an FTP accounts on a single website: On the website dashboard select the advanced...