How do I activate different PHP settings for added companion domains?

Procédure

Why add different PHP on companion domains?

You may be using companion domains to host other websites on your cPanel hosting. However, some of the sites you are going to set up will need a PHP version other than the base version in order to function. It will therefore be necessary to be able to modify the PHP version for companion domains via an .htaccess file.

How do I activate different PHP versions for added companion domains?

The .htaccess file should be placed in the directory associated with the companion domain you have added.

If you use a popular CMS such as WordPress or Prestashop for example, an .htaccess file is already present in the root folder of your website.

Depending on the version of PHP you want to use on your site, you will need to add the following lines to the .htaccess file:


SetHandler application/x-httpd-alt-phpXX___lsphp

⚠️ Warning: you need to change the value "phpXX" in the example above to the PHP version you want to use (e.g. php56 for PHP version 5.6, php72 for PHP version 7.2, etc.).

Conclusion

You now know how to :

  • Use companion domains to host multiple websites on a single cPanel hosting 😊,
  • Modify the PHP version for a specific companion domain using an .htaccess file 🛠️,
  • Insert the appropriate code in the .htaccess file to activate the desired PHP version 🔄.

We hope this information will help you optimise your sites hosted on cPanel and take full advantage of the flexibility offered by the different versions of PHP. Thank you for reading and feel free to leave a comment to share your experience or ask any questions 📝. Good luck with your digital projects! 😄👍

help.lws.net/a/1281
Was this article helpful?

Yes

No

Read 26 270 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

Questions about the article 1

Ask a question
Elodas
il y a 10 mois
Bonjour. LWS starter. J'ai ajouté un sixième site sur 10 possible et l'accès est impossible, pour les pages en PHP les autres s'affichent. L'accès PHP serait limité à 5 sites?
Jordan-LWS Official answer
il y a 10 mois

Bonjour,

Merci pour votre message. Malheureusement, je ne peux pas répondre directement à votre demande depuis ma position.

Je vous invite à contacter le service technique afin d’obtenir une assistance complète. Vous pouvez les joindre depuis votre espace client, via la rubrique « Assistance ».

Ils pourront analyser votre situation et vous apporter la solution adaptée.

Cependant, je vous confirme qu'il est bien possible d'avoir 10 sites internet sur votre formule d'hébergement et tout devrait être fonctionnel, il est donc possible qu'il y ait des soucis avec votre fichier ".htaccess" mais je ne serais pas en mesure de faire les analyses nécessaires, d'où l'intérêt d'ouvrir une demande au service technique.

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

Cordialement, L'équipe LWS 

Was this answer helpful?

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

GDPR: Controller: LWS-Ligne Web Services. Purpose: moderation and public publication of your question, possible notification of an answer. Legal basis: consent (Art. 6(1)(a) GDPR). Email retention: 90 days after notification, 12 months maximum without an answer. To exercise your rights, see the GDPR section of our Terms and Conditions.