2

I have installed both PHP versions (php5 & php7) on the same Linux server and it works for me, when I switch the version configuration on system.

Also it shows changes happen in the info.php file in the browser, but in terminal using php -v ,it shows only php7 version installed though it works under php5.

how can i correct the version information in php5 while chk in terminal?

1 Answer 1

1

When PHP is installed side to side there are different executables for the different versions. When you use a Web Server you choose which version to use via its configuration.

If php -v shows PHP 7 try php5 -v. If this returns the right version you can use php5 to run any script with php5.

To find out where exactly the PHP executables are use:

which php
whereis php
which php7
whereis php7
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.