简体   繁体   English

Plesk 和 CentOS 上的 PHP 版本不同吗?

[英]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.我对 Linux 服务器很陌生,但我发现了一些奇怪的东西,也许有人可以对此做出正确的解释:在我的域的“主机设置”的 PLESK 管理面板中,PHP 版本是 5.6。 But when I access via SSH to my server and type php -v it says that I have version 5.4.但是当我通过 SSH 访问我的服务器并输入 php -v 时,它说我有 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. 通过ssh会话运行php -v时,将运行系统或操作系统供应商的php。 Plesk PHPs for hosting are located in /opt/plesk/php/XX/bin/php where XX is version of PHP. 用于托管的Plesk PHP位于/ opt / plesk / php / XX / bin / php中,其中XX是PHP的版本。

Try this better option ssh as root user and use this commands one by one.以 root 用户身份尝试这个更好的选项 ssh 并一一使用此命令。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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