简体   繁体   中英

PHP Version on Plesk and CentOS are different?

I am quite new to Linux servers, but I found something strange to me and maybe someone can give a proper explanation for this: In PLESK Admin Panel on "Hosting Settings" for my domain the PHP version is 5.6. But when I access via SSH to my server and type php -v it says that I have version 5.4. Why the information is different and which one is the real?

When you run php -v via ssh session, you run system or OS vendor's php. Plesk PHPs for hosting are located in /opt/plesk/php/XX/bin/php where XX is version of PHP.

Try this better option ssh as root user and use this commands one by one.

mv /usr/bin/php /usr/bin/php.backup
mv /usr/bin/php-cgi /usr/bin/php-cgi.backup

ln -s /opt/plesk/php/5.6/bin/php /usr/bin/php
ln -s /opt/plesk/php/5.6/bin/php-cgi /usr/bin/php-cgi

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM