<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>composer on Tutes Club</title><link>https://tutes.in/tag/composer/</link><description>Recent content in composer on Tutes Club</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 12 Feb 2019 18:01:40 +0000</lastBuildDate><atom:link href="https://tutes.in/tag/composer/index.xml" rel="self" type="application/rss+xml"/><item><title>How to fix Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI error in SSH?</title><link>https://tutes.in/how-to-fix-composer-should-be-invoked-via-the-cli-version-of-php-not-the-cgi-fcgi-sapi-error-in-ssh/</link><pubDate>Tue, 12 Feb 2019 17:58:38 +0000</pubDate><guid>https://tutes.in/how-to-fix-composer-should-be-invoked-via-the-cli-version-of-php-not-the-cgi-fcgi-sapi-error-in-ssh/</guid><description>&lt;p&gt;Put this in your bash profile and run &lt;strong&gt;source ~/.bashrc&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; &lt;span class="nv"&gt;composer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/opt/cpanel/ea-php71/root/usr/bin/php /opt/cpanel/composer/bin/composer&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;p&gt;As Composer is now available via WHM you can use this to find it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;which composer
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This returned path “&lt;strong&gt;/opt/cpanel/composer/bin/composer&lt;/strong&gt;” for me. If this returns nothing then disregard the rest of this answer, as Composer is not available to you at system level.&lt;/p&gt;
&lt;p&gt;You can now use &lt;code&gt;php-cli&lt;/code&gt; to call this with Composer’s absolute path:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;php-cli /opt/cpanel/composer/bin/composer install
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;php-cli /opt/cpanel/composer/bin/composer update
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;php-cli /opt/cpanel/composer/bin/composer require whatever/example
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You may however need to alias &lt;code&gt;php-cli&lt;/code&gt; if your system claims this isn’t found. It very much depends how PHP has been deployed on the WHM server. &lt;a href="https://tutes.in/fix-magento-2-php-cli-error-on-cpanel-or-other-hostings/"&gt;Learn how to fix PHP CLI error&lt;/a&gt;. You can do this by adding a user alias to the end of your “&lt;strong&gt;.bashrc&lt;/strong&gt;” or “&lt;strong&gt;.bash_profile&lt;/strong&gt;” file as follows:&lt;/p&gt;</description></item></channel></rss>