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

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! 😄👍

Rate this article :

3.7/5 | 3 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

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

1mn reading

Use PHP Selector to activate PHP extensions on cPanel

1mn reading

1mn reading

How do I change max_upload_size and max_execution_time on cPanel?


Questions sur l'article
Elodas Il y a 29 days
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?
See the
1 answers
Jordan-LWS - Il y a 29 days

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 

Utile ?

Ask the LWS team and its community a question