{"id":7888,"date":"2026-04-23T10:16:12","date_gmt":"2026-04-23T08:16:12","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=7888"},"modified":"2026-04-23T10:16:14","modified_gmt":"2026-04-23T08:16:14","slug":"what-is-composer","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/","title":{"rendered":"What is Composer?"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#What_is_Composer\" >What is Composer?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#Step_1_Connect_via_SSH\" >Step 1: Connect via SSH<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#Step_2_Download_Composer\" >Step 2: Download Composer<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#Step_3_Create_or_Manage_a_Project\" >Step 3: Create or Manage a Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#Step_4_Configure_the_Web_Directory_Symbolic_Links\" >Step 4: Configure the Web Directory (Symbolic Links)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#How_to_run_standard_Composer_commands\" >How to run standard Composer commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#Practical_Implications_for_mybox_Users\" >Practical Implications for mybox Users<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/what-is-composer\/#Summary\" >Summary<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Composer\"><\/span>What is Composer?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Composer is the industry-standard dependency manager for PHP. It allows you to declare the libraries your project depends on and manages (installs\/updates) them for you. Instead of manually downloading ZIP files for every library, Composer automates the process and ensures all components are compatible with each other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the <strong>mybox<\/strong> environment, you use a local version of Composer (<code>composer.phar<\/code>). This gives you the flexibility to use different Composer versions for different projects while maintaining full control over your PHP environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Connect_via_SSH\"><\/span>Step 1: Connect via SSH<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-2212992316\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">To use Composer, you must be connected to your server&#8217;s command line.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Enable SSH in the <strong>mybox panel<\/strong>.<\/li>\n\n\n\n<li>Connect using a terminal or PuTTY.<\/li>\n\n\n\n<li>Navigate to your domain&#8217;s directory:<code>cd yourdomain.com<\/code><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Download_Composer\"><\/span>Step 2: Download Composer<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since you will run Composer locally, you need to download the executable archive into your folder.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Download the latest stable version:<code>wget https:\/\/getcomposer.org\/download\/latest\/composer.phar<\/code><\/li>\n\n\n\n<li>(Optional) Grant execute permissions to the file:<code>chmod +x composer.phar<\/code><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Create_or_Manage_a_Project\"><\/span>Step 3: Create or Manage a Project<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When running Composer commands at <strong>mybox<\/strong>, you must specify which PHP version you want to use. This ensures your libraries are compatible with your site&#8217;s settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example: Creating a new Laravel project using PHP 8.2<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>php82 composer.phar create-project --prefer-dist laravel\/laravel my_new_app<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example: Requiring a new package (e.g., PHPMailer)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>php82 composer.phar require phpmailer\/phpmailer<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Configure_the_Web_Directory_Symbolic_Links\"><\/span>Step 4: Configure the Web Directory (Symbolic Links)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Modern PHP frameworks like Laravel or Symfony keep their entry point in a <code>\/public<\/code> subfolder for security. However, the <strong>mybox<\/strong> server looks for your website in the <code>public_html<\/code> directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To bridge this, you can create a <strong>symbolic link<\/strong>:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>If an empty <code>public_html<\/code> exists, remove it: <code>rm -rf public_html<\/code><\/li>\n\n\n\n<li>Link your project&#8217;s public folder to <code>public_html<\/code>:<code>ln -s my_new_app\/public public_html<\/code><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Now, when a visitor accesses your domain, the server will correctly serve the files from your Composer-managed project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_run_standard_Composer_commands\"><\/span>How to run standard Composer commands<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Simply replace the word <code>composer<\/code> with <code>phpXX composer.phar<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Standard Command<\/strong><\/td><td><strong>mybox Equivalent (using PHP 8.2)<\/strong><\/td><\/tr><\/thead><tbody><tr><td><code>composer install<\/code><\/td><td><code>php82 composer.phar install<\/code><\/td><\/tr><tr><td><code>composer update<\/code><\/td><td><code>php82 composer.phar update<\/code><\/td><\/tr><tr><td><code>composer require [package]<\/code><\/td><td><code>php82 composer.phar require [package]<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_Implications_for_mybox_Users\"><\/span>Practical Implications for mybox Users<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>PHP Version Matching:<\/strong> Always use the same PHP version in the command line (e.g., <code>php82<\/code>) that you have selected for your domain in the <strong>mybox panel<\/strong>. This prevents &#8220;version mismatch&#8221; errors where Composer installs a library that your website cannot actually run.<\/li>\n\n\n\n<li><strong>Memory Limits:<\/strong> Large Composer operations (like <code>update<\/code>) can be memory-intensive. If a process stops unexpectedly, check your <strong>mybox panel<\/strong> resource logs to see if a temporary <strong>Boost Pack<\/strong> is needed for the installation.<\/li>\n\n\n\n<li><strong>Security:<\/strong> Keep your <code>composer.phar<\/code> file outside of the <code>public_html<\/code> directory if possible, or ensure your <code>.htaccess<\/code> prevents it from being downloaded by visitors.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Using Composer at <strong>mybox<\/strong> is a straightforward process that enables you to build professional, modern PHP applications. By utilizing the <code>composer.phar<\/code> file and specifying your PHP version, you maintain a clean, isolated, and highly manageable development environment.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[28],"manual_kb_tag":[9048,9049,9050,9051,9052,1499,4396,9045,9046,9047],"class_list":["post-7888","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-others","manual_kb_tag-local-composer","manual_kb_tag-composer-installation","manual_kb_tag-composer-update","manual_kb_tag-composer-require","manual_kb_tag-php8","manual_kb_tag-composer-commands","manual_kb_tag-composer-install","manual_kb_tag-composer","manual_kb_tag-dependency-manager","manual_kb_tag-composer-phar"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7888\/revisions"}],"predecessor-version":[{"id":7889,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7888\/revisions\/7889"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=7888"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=7888"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=7888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}