How do I configure PHP on my hosting?

Procédure

What is PHP?

PHP is a programming language that can be integrated into HTML pages.

It is used to automate repetitive tasks, in particular by communicating with a database (the most common use of PHP).

The PHP programming language is essential for the smooth operation of CMS such as Wordpress, Joomla, Prestashop, etc., as well as for all e-mail forms.

This article is aimed solely at customers who have chosen Linux shared web hosting.

If you have a Virtual Private Server (VPS), find out how to modify php.ini

How do I access the PHP settings for my hosting?

First of all, you need to log in to your LWS account and access the shared hosting for which you want to modify the PHP settings.

Then click on the"PHP Configuration" icon in the"Database & PHP" section:

How do I configure PHP on my hosting?

How do I install a PHP version and select the default PHP version for hosting?

PHP, which stands for "PHP: Hypertext Preprocessor", is a programming language widely used for web development. A PHP version refers to a specific iteration of this language, with its own features, improvements and bug fixes.

Choosing the right version of PHP for your website is crucial for a number of reasons. Firstly, each new version brings improvements in terms of performance and security. Using an obsolete version can expose the site to security risks and reduce page loading speed. Secondly, recent versions offer new functionalities and greater compatibility with modern web technologies, making it possible to create more sophisticated and functional sites. Finally, keeping your PHP version up to date ensures better compatibility with plugins and themes, which are essential for content management systems such as WordPress.

However, some sites or applications may not be fully operational with the latest version of PHP, in which case using an earlier version may be the solution. If you have several applications on your hosting, they may each need a different version of PHP.

In the first tab that appears,"Installing and selecting PHP", you can determine which versions of PHP you want to use with the different applications on your hosting.

How do I configure PHP on my hosting?

All you have to do is tick or untick the box corresponding to the PHP version so that it can be installed or uninstalled after clicking on the"Save" button.

You can activate all versions of PHP, but this may slow down your hosting and the speed of your sites. We advise you to activate only the versions you need. At the very least, one version must be ticked and installed on the hosting
.

You can also specify which version of PHP will be used by default on your hosting. This setting is particularly useful if you need to use several versions of PHP.

How do I configure PHP on my hosting?

Select the PHP version and indicate in the selector whether you want to apply this version only to your site accessible from the main domain name or to all the sites on the hosting. Then click"Save" to apply the change.

How do I configure a different version for the sites on my hosting?

From the"PHP configuration by sites" tab, you can specify a different PHP version for all the sites on your hosting.

How do I configure PHP on my hosting?

This page lists all the additional domains added to your hosting as multi-domains, as well as all the sub-domains created.

You then have the option of choosing the PHP version to be applied for each domain or sub-domain in the listing by selecting the version in the selector.

Then click the"Save" button at the bottom of the page to apply the changes.

For a PHP version to be proposed in the selector, it must first be installed (ticked) in the"PHP installation and selection" tab
.

How do I change the PHP settings for my hosting?

Various PHP parameter settings are available in the"General PHP configuration" tab.

The PHP settings configured in this tab apply to your entire hosting, regardless of the PHP version used.

The values that can be configured for certain parameters (memory_limit, max execution-time, etc.) differ depending on the hosting package chosen.

How do I configure PHP on my hosting?

The parameters available for configuration are as follows:

  • Installation of ATOS/PAYBOX binaries if your site uses a payment module requiring these binaries
  • allow_url_fopen, which authorises access to files via a URL, and allow_url_include, which allows remote files to be included in the code of your website.
  • Display_errors, which displays PHP-generated errors on your site (ideal when the site is under development or being deployed).
  • error_reporting allows you to specify different levels of reporting of PHP errors in the PHP logs of your hosting.
  • Memory_Limit limits the memory allocated to PHP scripts (maximum value depends on the formula)
  • Max_execution_time which limits the maximum execution time of a PHP script (maximum values depend on the formula)
  • Max_upload_size which limits the maximum size of files that can be uploaded (depends on the Memory_limit value selected)
  • Post_max_size which limits the size of files that can be submitted via the POST method (depends on the Memory_limit value selected)
  • Max_file_uploads, which limits the number of files that can be uploaded simultaneously
  • OPcache, which caches compiled PHP code to improve performance
  • TimeZone, which determines the time zone your website will be based in.

How can I check the version of PHP actually used by my website?

You can check which version of PHP is running in a folder by creating a phpinfo.php file in that folder with the following contents:

You can use the FileManager available on your hosting to create and edit the file.

Then visit the following page via your web browser: http://domaine.com/dossier/phpinfo.php (replace "domain.com" with your domain name and "folder" with the folder where you have placed your php file)

The following page should be displayed, showing the PHP version used by this folder and the various PHP settings and libraries installed.

How do I configure PHP on my hosting?

Conclusion

You are now able to configure PHP on your shared hosting with LWS. PHP configuration lets you change the PHP version used for your hosting. You can also modify a few PHP directives.

If you have any questions, don't hesitate to contact our technical support team via a trouble ticket.

Rate this article :

3.9/5 | 10 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

2mn reading

How do I create a cron job?

3mn reading

Customisation of error pages

0mn reading

How to access Apache / Php logs

2mn reading

How do you change the PHP version of your Joomla site to 7?


Questions sur l'article
Diouz Il y a 370 days
Je veux développer une application Web avec php sans utiliser les framework. Est il possible dans vos formules d'hébergement ? Avez-vous des outils que vous mettez en place au développeur dans ce cas de figure ?
See the
1 answers
Benjamin-LWS - Il y a 367 days

Bonjour,

Merci de votre retour.

Bien sûr, cela est possible, sur toutes nos formules d'hébergement à part la formule domaine.

Il n'y pas forcément d'outils mis en place pour les développeurs, mais vous pouvez éditer des fichiers depuis le gestionnaire de fichiers du panel.

Je vous remercie de votre attention et reste à votre disposition pour toute autre question ou complément d'information.

Nous vous invitons à contacter notre service support à travers votre espace client, afin de vous apporter une aide si vous rencontrez des difficultés quelconque. (Contacter le support LWS)

Cordialement, L'équipe LWS 

Utile ?
Basil Il y a 228 days
Bonjour, j'utilise prestashop et dans sa version de base il a besoin de la fonction proc_open pour l'envoi de mail avec swiftmailer. Cependant j'ai vu que cette fonction était désactivée dans la configuration PHP de LWS. Quelle est l'alternative svp?
See the
1 answers
Jordan-LWS - Il y a 223 days

Bonjour,

Je vous remercie pour votre message.

Je suis désolé de l'inconfort que vous rencontrez avec la fonction désactivée

Malheureusement, nous avons dû restreindre cette fonction PHP pour des raisons de sécurité et cela est indiqué dans nos CGV, des alternatives existent effectivement, par exemple PHP Mailer qui peut remplacer Swiftmailer, si malheureusement, vous souhaitez utiliser Swiftmailer à tout prix, il ne sera pas possible de l'utiliser sur nos services étant donné que l'accès à cette fonction est restreinte. 

Je vous remercie pour votre attention et reste à votre disposition pour toute autre question ou complément d'information. Vous pouvez nous contacter directement depuis votre espace client si vous le souhaitez afin de faciliter les échanges et trouver des solutions à vos problèmes.

Cordialement, L'équipe LWS.

 

Utile ?

Ask the LWS team and its community a question