PHP versions and settings

PHP is a programming language and stands for PHP: Hypertext Preprocessor. Various PHP settings can be adjusted for a domain connected to the hosting package, including the PHP version and other PHP parameters. These settings are managed in the Web & Mail Control Panel.

 

Open PHP Settings

  1. Log in to my.green.ch with your MY username and password.
  2. Open All Domains.
  3. For the desired domain, click the arrow icon to the right of the hosting.
  4. In the Control Panel, open the Domains section.
  5. For the desired domain, select Actions → PHP Settings.
  6. Select the desired PHP version.
  7. Save the change.

Further information about accessing the Web & Mail Control Panel:

https://www.green.ch/en/accessing-the-control-panel

Further information about domain settings:

https://www.green.ch/en/domain-settings-domain-connected-to-hosting-package

 

What You Should Consider Before Changing the PHP Version

Whether a new PHP version works without issues depends on your website and the extensions you use. Check compatibility with your webmaster first.

  • Check the compatibility of your CMS.
  • Check installed plugins, themes, and extensions.
  • Create a backup of your website before making changes.
  • Test the website thoroughly after the change.

Current WordPress installations support current PHP versions. However, individual third-party plugins may still cause incompatibilities. If errors occur after changing the PHP version, you can usually switch back to the PHP version you were previously using.

Important: Due to the individual combination of the components used, our customer service cannot assess compatibility. Please contact your webmaster for assistance.

 

Available Settings

The following values can be adjusted:

  • PHP version
  • allow_url_fopen
  • allow_url_include
  • display_errors
  • opcache.enable

The following parameters are also displayed:

  • max_memory_limit
  • max_execution_time

 

Description of the Individual Settings

PHP Version

Here you specify which PHP version is used for the domain. Newer PHP versions include new features as well as security and performance improvements.

If you use a CMS such as WordPress, check which PHP version is supported by WordPress, your themes, and installed plugins before making a change.

Note: After changing the PHP version, check whether your website still functions correctly. Individual plugins or extensions may be incompatible with newer PHP versions.

Further information:

https://www.green.ch/en/php-settings-domain-assigned-to-hosting-package

 

allow_url_fopen

This setting allows PHP to access remote files and resources via supported URL wrappers.

This allows applications to access external files or content that are not located on the same web server.

Note: Enable this option only if it is technically required for your application.

 

allow_url_include

This setting allows URL-based resources to be used in the following PHP functions:

  • include
  • include_once
  • require
  • require_once

Note: This setting requires allow_url_fopen to be enabled.

 

display_errors

This setting displays PHP error messages and notices directly on the website.

This can be helpful for troubleshooting because warnings and error messages are immediately visible.

Note: For publicly accessible websites, this setting should be disabled for security reasons.

 

opcache.enable

OPcache stores compiled PHP bytecode in the cache. This means that PHP does not have to recompile scripts each time they are called repeatedly.

This setting can affect the processing speed of PHP applications.

Note: It is recommended to leave this setting enabled.

Further information:

https://www.green.ch/en/how-can-i-enable-opcache-in-the-web-control-panel

 

max_memory_limit

This value shows the maximum amount of memory available to a PHP script.

If this value is exceeded, script execution may fail or be terminated.

The available value depends on the hosting package used.

 

max_execution_time

This value shows the maximum execution time of a PHP script in seconds. Once this time has elapsed, execution is terminated.

The available value depends on the hosting package used.

 

Outdated PHP Versions

Whenever possible, always use current PHP versions.
Further information about using older PHP versions can be found here.

 

Typical Errors After Changing the PHP Version

If a website displays errors after changing the PHP version, first check whether all components used are compatible with the selected PHP version.

  • Outdated plugins or extensions
  • Unsupported themes
  • Outdated CMS versions
  • Incompatible custom programming
  • Outdated database or PHP libraries

Typical symptoms of an incompatible PHP version include:

  • Error 500
  • Error 503
  • Blank pages
  • PHP error messages
  • Plugins or themes not working

 

OPcache

OPcache stores already compiled PHP scripts in memory. This allows PHP applications to run faster and reduces server load.

OPcache can improve performance, particularly for WordPress and other CMS systems.

Further information can be found here:

https://www.green.ch/en/how-can-i-enable-opcache-in-the-web-control-panel

 

PHP and WordPress

WordPress requires a compatible PHP version. After updates to WordPress, themes, or plugins, it may also be necessary to adjust the PHP version.

Further information about WordPress can be found here:

https://www.green.ch/en/general-wordpress-errors-updates-etc

https://www.green.ch/en/wordpress-error-503

https://www.green.ch/en/wordpress-installation-and-tips

 

Composer and PHP

Composer is a package manager for PHP applications. Some modern PHP projects require Composer to install or update dependencies.

When using Composer, the appropriate PHP version must be used. Depending on the application, it may be necessary to run Composer explicitly with a specific PHP version.

Further information can be found here:

https://www.green.ch/en/composer

 

Limitations of Shared Hosting

Shared hosting is designed for most websites and standard applications. However, certain custom server modifications or special PHP configurations cannot be implemented.

These include, for example:

  • Arbitrary changes to server-wide PHP settings
  • Installation of custom server services
  • Installation of custom PHP extensions at server level
  • Full control over the server's PHP configuration

Note: If your application has specific PHP requirements or requires custom server components, shared hosting may not be sufficient.

 

Scope of Support

Green provides the hosting platform and the available PHP versions.

Adjustments to websites, CMS systems, plugins, themes, custom programming, or third-party extensions are not included in the regular scope of support.

Further information can be found here:

https://www.green.ch/en/outside-of-hosting-support