How to change the centos php version: 1. Use "php -v" to view php version information; 2. Execute the "locate */php" command; 3. Modify the php version loading path in the environment variable file; 4. Execute "source /etc/profile".
The operating environment of this article: centOS6.8 system, PHP7.2 version, DELL G3 computer
How to change the php version of centos ?
centos switch php version
The php version php5.3 to php7.2 is installed on the centos server, and the default usephp -v
, the PHP version information viewed is:
Modify the environment variable file: vim /etc/profile
shift g
jumps to the last line of the environment and sees:
php is loaded by default under /usr/local/php/bin
, so the version It is 5.6
Next, you need to find the location of the php execution program of version 7.2, execute locate */php
to see:
You can see php7. The location of version 2 is: /usr/local/php72/bin/php
So, modify the php version loading path in the environment variable file to /usr/local/ php/bin
is changed to /usr/local/php72/bin
.
Execute source /etc/profile
to make the modification effective.
Execute againphp -v
See that the current default php has been changed to php7.2 version
Recommended study: " PHP video tutorial》
The above is the detailed content of How to change the php version of centos. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools
