简体   繁体   English

更改Composer PHP版本路径Plesk

[英]Change Composer PHP Version Path Plesk

RESOLVED : 解决 :

For plesk users you need to make nano .bash_profile when you are in the file add this line : 对于plesk用户,当您在文件中添加此行时,您需要制作nano .bash_profile:

PATH=/opt/plesk/php/7.1/bin:$PATH 

it will work for ssh users !! 它适用于ssh用户!!

for root ssh user you can do : 对于root ssh用户,你可以这样做:

export PATH=/opt/plesk/php/7.1/bin:$PATH;

Hope it will help 希望它会有所帮助

I try to say to composer that now he needs to look on the php version 7.1 wish is installed on my plesk serveur. 我试着对作曲家说,现在他需要看看我的plesk serveur上安装的php版本7.1愿望。

how i could do this ? 我怎么能这样做? i am not a pro in commands line.. i think i need to add this line 我不是命令行的专家..我想我需要添加这一行

export PATH=/opt/plesk/php/7.1/bin:$PATH; in my .bashrc file but i really don't know how to access to this and how to add the line. 在我的.bashrc文件中但我真的不知道如何访问它以及如何添加该行。

hope someone could help me for this, thanks a lot in advance. 希望有人可以帮我这个,非常感谢提前。

Actually i need to do manualy this to update composer : 其实我需要做手工更新作曲家:

export PATH=/opt/plesk/php/7.1/bin:$PATH; php composer.phar update

A slightly alternative version if it may help anyone: 一个稍微替代版本,如果它可以帮助任何人:

Create an alias for composer and store it in /etc/profile.d (so it is available to all users) 为composer创建一个别名并将其存储在/etc/profile.d中(因此它可供所有用户使用)

cd /etc/profile.d
nano composer7.sh

In your file put this (adjusting for version & composer location): 在你的文件中放这个(调整版本和作曲家位置):

alias composer7='/opt/plesk/php/7.0/bin/php /usr/local/bin/composer.phar'

Save the file and login again. 保存文件并重新登录。

Your script can now be used from command line even if your installation of Plesk is running a different version of php. 现在可以从命令行使用您的脚本,即使您的Plesk安装正在运行不同版本的php。 Now you can execute it like: 现在你可以执行它:

composer7 update

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

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