Change PHP version through .htaccess

Discussion in 'Installation/Configuration' started by razor7, Jan 16, 2019.

  1. razor7

    razor7 Member

    Hi! On a cPanel site, I can chage the PHP version by adding this line to the .htaccess file:
    Code:
    AddHandler application/x-httpd-php70 .php
    I have an ISPConfig3 Installatin that I use as development server, and in a single web folder I have several projects and some of them need PHP7
    Is it possible to change PHP version using .htaccess AddHandler directive for a specific folder using ISPconfig? How?
    Thanks!
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. razor7

    razor7 Member

    Hi! Thanks for the reply!

    I know I can change PHP version per site, that's what I'm doing right now, but I wanted to know if I can change PHP version as per folder through AddHandler in .htaccess

    Thanks in advise!
     
  4. Bartiff

    Bartiff New Member

    Hi !
    Do you find an answer to your question?
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Why not try it and see if it works?
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    If your server is setup correctly, no, it will not work. Each site has a php daemon configured to run as the user/group of that website, and while you could probably point your site to use another site's php daemon (at least until https://git.ispconfig.org/ispconfig/ispconfig3/issues/4010 is implemented), you cannot properly configure a php daemon for your site's user/group/etc. via an .htaccess file.
     

Share This Page