DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Why You Should Use Buildpacks Over Docker
  • Build Quicker With Zipper: Building a Ping Pong Ranking App Using TypeScript Functions
  • Auto-Scaling a Spring Boot Native App With Nomad
  • Android Cloud Apps with Azure

Trending

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Safeguarding Sensitive Data: Content Detection Technologies in DLP
  • 5 Popular Standalone JavaScript Spreadsheet Libraries
  • Integrating Apache Spark With Drools: A Loan Approval Demo
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Install PHP Composer via SSH for Dependencies Management of Your Cloud App

Install PHP Composer via SSH for Dependencies Management of Your Cloud App

In this post we take a look at how to install the popular PHP dependency management tool, Composer, via SSH to help with our cloud-based PHP applications.

By 
Tetiana Markova user avatar
Tetiana Markova
·
Nov. 17, 16 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
10.2K Views

Join the DZone community and get the full member experience.

Join For Free

php composer guide to consolidate and centralize the management of dependencies can be a real problem for complex cloud applications. that is why the right decision here is to use already-proven, on the market dependency management tools.

composer is one of the most popular dependency management solutions for php, inspired by node’s npm and ruby’s bundler . it smartly manages all the required libraries and packages for your application. running on a per-project basis, composer determines which versions of which packages your project depends on and installs them in a working directory. moreover, this tool provides automatic updates load , allowing to keep your packages actual.

follow the instructions below to install php composer via jelastic ssh gateway and perform its configuration, that will enable us to execute it from any working directory throughout a server.

1. in order to run the composer installation by means of jelastic ssh gateway , you need to:

  • generate an ssh keypair.
  • add your public ssh key to the dashboard.
  • access your account via ssh protocol.

once you’ve established ssh connection to your apache php or nginx php server ( apache 2.4 in our example), you can easily integrate composer into your project.

2. run the composer installer from inside your server working directory to download the appropriate composer.phar archive:

curl -ss https://getcomposer.org/installer | php


php composer

3. rename the composer.phar file to just “ composer ” and move it to the private bin directory with the below commands:

mkdir ~/bin mv ~/composer.phar ~/bin/composer

install php composer

4. now, let’s add composer to the server path variable in order to be able to further execute it from any server directory. in such a way, you won’t have to write out the full path (i.e. /var/www/bin/composer ) for calling this dependencies manager when necessary.

for that, run one of the following commands depending on used application server:

  • for apache php :
export path=$path:/var/www/bin echo 'export path=$path:/var/www/bin' >> ~/.bash_profile

php composer ssh

  • for nginx php :
export path=$path:/var/lib/nginx/bin echo 'export path=$path:/var/lib/nginx/bin' >> ~/.bash_profile

php composer path
that’s it! composer is added to your path variable now.

5. everything is already set up! you can run the following command in order to ensure that php composer works as intended:

composer about

php composer manager

great! start using composer on your apache or nginx server and easily control dependencies within your php projects.

if you face any issues while installing php composer via jelastic ssh gateway, feel free to appeal for our technical experts’ assistance at stackoverflow .

Composer (software) Dependency PHP Cloud app

Published at DZone with permission of Tetiana Markova, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Why You Should Use Buildpacks Over Docker
  • Build Quicker With Zipper: Building a Ping Pong Ranking App Using TypeScript Functions
  • Auto-Scaling a Spring Boot Native App With Nomad
  • Android Cloud Apps with Azure

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: