{"id":699,"date":"2020-10-01T14:58:45","date_gmt":"2020-10-01T08:58:45","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=699"},"modified":"2020-10-01T14:58:45","modified_gmt":"2020-10-01T08:58:45","slug":"how-to-run-composer-in-plesk-user-shell-plesk-php","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-run-composer-in-plesk-user-shell-plesk-php.html","title":{"rendered":"How to run Composer in Plesk User Shell \/ Plesk PHP"},"content":{"rendered":"\n<p>There are couple of ways you can run composer with Plesk Shell. My favorite one is to add php to your PATH variable, and it will automatically add the composer as well. You may follow through the following to modify your shell path variable to use Plesk PHP:<\/p>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-mellowhost-blog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"V2K1Om4gGZ\"><a href=\"https:\/\/mellowhost.com\/blog\/how-to-add-php-in-default-path-for-plesk-how-to-fix-bash-php-command-not-found-for-plesk-user.html\">How to Add PHP in Default Path for Plesk \/ How to Fix -bash: php: command not found for Plesk User<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;How to Add PHP in Default Path for Plesk \/ How to Fix -bash: php: command not found for Plesk User&#8221; &#8212; Mellowhost Blog\" src=\"https:\/\/mellowhost.com\/blog\/how-to-add-php-in-default-path-for-plesk-how-to-fix-bash-php-command-not-found-for-plesk-user.html\/embed#?secret=V2K1Om4gGZ\" data-secret=\"V2K1Om4gGZ\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Once done, now you may run composer command and it shall work:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[elastic-keldysh@pl1 ~]$ composer -V\nComposer version 1.10.5 2020-04-10 11:44:22\n[elastic-keldysh@pl1 ~]$\n<\/pre>\n\n\n\n<p>The other way, is to directly use the composer.phar given from Plesk 9.0 library. This file is available under the following location:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/usr\/lib64\/plesk-9.0\/composer.phar<\/pre>\n\n\n\n<p>So, you may run this using the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[elastic-keldysh@pl1 ~]$ \/opt\/plesk\/php\/7.4\/bin\/php \/usr\/lib64\/plesk-9.0\/composer.phar -V\nComposer version 1.10.13 2020-09-09 11:46:34<\/pre>\n\n\n\n<p>This should work too. You may choose any, and it shall work for you. Good luck.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are couple of ways you can run composer with Plesk Shell. My favorite one is to add php to your PATH variable, and it will automatically add the composer as well. You may follow through the following to modify your shell path variable to use Plesk PHP: Once done, now you may run composer &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-run-composer-in-plesk-user-shell-plesk-php.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to run Composer in Plesk User Shell \/ Plesk PHP&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[144,273,509],"tags":[515,304,275,510,516],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/699"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=699"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/699\/revisions"}],"predecessor-version":[{"id":700,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/699\/revisions\/700"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}