Home >Backend Development >PHP Tutorial >How to Integrate Composer into Shared Hosting Without SSH Access?

How to Integrate Composer into Shared Hosting Without SSH Access?

Barbara Streisand
Barbara StreisandOriginal
2024-10-18 11:33:02838browse

How to Integrate Composer into Shared Hosting Without SSH Access?

Integrating Composer into Shared Hosting

For those lacking SSH access and seeking Composer installation, there's a resourceful approach.

Step-by-Step Guide:

  1. Download and Install Composer:

    cd ~
    mkdir bin
    mkdir bin/composer
    curl -sS https://getcomposer.org/installer | php
    mv composer.phar bin/composer
  2. Locate php-cli:

    which php-cli
  3. Edit ~/.bashrc:
    Ensure the following line is at the top:

    [ -z "$PS1" ] && return

    Add this alias at the bottom:

    alias composer="/usr/bin/php-cli ~/bin/composer/composer.phar"
  4. Finalize Installation:

    source ~/.bashrc
    composer --version

The above is the detailed content of How to Integrate Composer into Shared Hosting Without SSH Access?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn