{"id":353,"date":"2021-12-15T06:20:36","date_gmt":"2021-12-15T06:20:36","guid":{"rendered":"https:\/\/www.hostingahead.com\/blog\/?p=353"},"modified":"2021-12-15T06:23:19","modified_gmt":"2021-12-15T06:23:19","slug":"run-composer-with-different-php-version","status":"publish","type":"post","link":"https:\/\/www.hostingahead.com\/blog\/run-composer-with-different-php-version\/","title":{"rendered":"Run composer with different PHP version"},"content":{"rendered":"<p>If multiple PHP versions are installed on your server you need to tell the composer which PHP version to be used.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>The below commands tell the composer to use PHP version 7.4. <\/strong><\/p>\n<p><code>alias php=\"\/opt\/cpanel\/ea-php73\/root\/bin\/php\"<br \/>\nalias composer=\"\/opt\/cpanel\/ea-php73\/root\/bin\/php \/opt\/cpanel\/composer\/bin\/composer\"<\/code><\/p>\n<p>Notes:<br \/>\nThe is a Cpanel server and the path mentioned above are for the Cpanel server only. If you use custom PHP, use the correct path accordingly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If multiple PHP versions are installed on your server you need to tell the composer which PHP version to be used. &nbsp; The below commands tell the composer to use PHP version 7.4. alias php=&#8221;\/opt\/cpanel\/ea-php73\/root\/bin\/php&#8221; alias composer=&#8221;\/opt\/cpanel\/ea-php73\/root\/bin\/php \/opt\/cpanel\/composer\/bin\/composer&#8221; Notes: The is a Cpanel server and the path mentioned above are for the Cpanel server only. &#8230;<\/p>\n","protected":false},"author":101012,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,63],"tags":[64,65,66],"_links":{"self":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/353"}],"collection":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/users\/101012"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":5,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":356,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions\/356"}],"wp:attachment":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}