doushi1900 2019-06-11 14:46
浏览 66


I am new to the composer, I have a VPS with several domains hosted. The VPS is the CentOS. Now I need to install the composer in order to meet several PHP systems' requirement. Now I have several questions about the installation.

1st, I have several systems, should I need to install several composers for each?

2nd, I have the root account to VPS and also have several cPanel accounts on it, owner and group are different to different cPanel accounts, when I install the composer, should I need to log in with different accounts and install it or only install by root?

3rd, where should I place the composer, any specific folder or the folder directly under the PHP system?

Hope someone can help to answer the above questions.

Best regards,


  • 写回答

1条回答 默认 最新

  • douyue2313 2019-06-11 17:29

    1st - You need to install composer tool globally. This means that you need to install it once but you need to run composer install on each folder that has a composer.json file, in order to install its dependencies.

    2nd - I am not sure how you server is organised regarding permissions, but I think installing it with root is enough.

    3rd - I normally move and rename the composer.phar file to a location like /usr/local/bin.

    --- Try doing these steps ---

    Download composer (get instructions on link below)

    Make the phar executable:

    chmod a+x composer.phar

    Run this to move and rename it:

    mv ./composer.phar /usr/local/bin/composer

    After this, you should be able to call composer from anywhere on your server. To test it, simply run: composer.

    Now proceed to you app folder (where composer.json is located) and run: composer install

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



    • ¥15 关于网上一个easyx制作的见缝插针小游戏(c++)
    • ¥15 开地址法双散列函数处理碰撞
    • ¥15 想问一下这个是什么情况 虚拟机Linux打不开了
    • ¥15 联通光猫掉注册了怎么重新注册上去
    • ¥15 关于unity开发steamvr程序遇到的问题
    • ¥60 求tc downloader的下载方式
    • ¥15 华为 快捷方式 手电筒 接口
    • ¥15 Qt6.5支不支持Android13开发啊
    • ¥20 网络只能跑一半,应该如何设置
    • ¥20 Python调用百度开发者平台人脸识别接口