宝塔面板默认的PHP版本如何切换
展开阅读全文

今天启动命令提示这个:

Fatal error: Cannot access self:: when no class scope is active in /www/wwwroot/qun.meixiunet.com/GatewayWorker/Applications/YourApp/function/chat.php on line 26
Worker[22570] process terminated with ERROR: E_ERROR "Cannot access self:: when no class scope is active in /www/wwwroot/qun.meixiunet.com/GatewayWorker/Applications/YourApp/function/chat.php on line 26"
worker[YourAppBusinessWorker:22570] exit with status 65280

最终发现是宝塔的默认php版本问题,我这个是php56 但是宝塔默认是php53

先查看下系统默认php命令关联的PHP版本,在命令行输入 ls -l /usr/bin/php 显示:

打开/www/server/php目录可以看到通过宝塔安装的多个PHP版本都在此处:

要更改成7.2的执行以下命令 ln -sf /www/server/php/72/bin/php /usr/bin/php 即可: