How to Run Multiple Websites with Different PHP Versions in Nginx

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

20 Responses

  1. markonah says:

    How to implement this to active for both PHP 5.6 and 7.2 in Apache virtual host?

    please write the tutorial…

    thanks in advanced

  2. CTrace says:

    How do I switch from php7.1 to php5.6 in command?

    I want php5.6 running in cli mode,

    $ php -v 

    Should output php5.6 not php7.1, which is my now in my current system.

  3. Aaron Smith says:

    Is there a known way to switch this process? I have several machines that have PHP 5.6 running and I want to add php 7 to those machines. Let me know.

  4. Natka says:

    How to Configure step 7 in apache 2.4

    Thanks in advance.

  5. says:

    good job!

    point 13 need adjust the content of website1 and website2

  6. Zulmi says:

    Thank you very much, it really helped.

  7. Grace says:

    Hi I got this message when run this command.

    Loaded module fastestmirror
    Repository packages-microsoft-com-prod is listed more than once in the configuration

    How to fix that?

  8. Hank Cape says:

    Just for those (others) running these on automaton, there might be a good reason to add instructions starting database in Step 3 between 6. and 7. :) I knew it but some others might not get it and they might get frustrated.

    • Hank Cape says:

      Also, Step 5 point 12. The second to last line is incorrect, systemctl enable php56-fpm should be systemctl enable php56-php-fpm.

      I don’t need these comments to be published, just to inform you about these two things in otherwise excellent article.


Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.