how to change php version in htaccess in server

I’m using php 5.6 on my local machine. On our web server we have php 7.0.  So I want to change the php version on our server via .htaccess file. Is it possible to change? If yes so please tell me how to do it?

Asked on November 21, 2019 in Wordpress.
Add Comment
  • 1 Answer(s)

    You can change php by adding php handler in htaccess

    for php 7.4

    AddHandler application/x-httpd-php74 .php
    

    for php 8

    AddHandler application/x-httpd-php8 .php
    

    for php 8.1

    AddHandler application/x-httpd-php81 .php
    
    Answered on November 12, 2022.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.