{"id":27148,"date":"2019-05-17T11:49:19","date_gmt":"2019-05-17T09:49:19","guid":{"rendered":"https:\/\/hetzner.co.za\/help-centre\/?p=27148"},"modified":"2025-12-30T14:10:06","modified_gmt":"2025-12-30T12:10:06","slug":"composer","status":"publish","type":"post","link":"https:\/\/xneelo.co.za\/help-centre\/products-and-services\/dedicated-hosting\/managing-dedicated-hosting\/composer\/","title":{"rendered":"Composer"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Composer is a dependency management tool for PHP. It allows you to manage the libraries your project depends on and runs updates on these dependencies for you. <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Composer is now installed on all Managed Servers and uses the PHP configuration and version specified in the <\/span><a href=\"https:\/\/xneelo.co.za\/help-centre\/control-panel\/what-directives-can-be-changed-php-config-tool\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">PHP Config tool<\/span><\/a><span style=\"font-weight: 400;\"> in your Control Panel. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is a more modern approach to package management and is s<\/span><span style=\"font-weight: 400;\">trongly inspired by Node&#8217;s <\/span><a href=\"https:\/\/www.npmjs.com\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">npm<\/span><\/a><span style=\"font-weight: 400;\"> and Ruby&#8217;s <\/span><a href=\"https:\/\/bundler.io\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">bundler<\/span><\/a><span style=\"font-weight: 400;\">. More information on Composer usage can be found <\/span><a href=\"https:\/\/getcomposer.org\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">You can choose between two methods of installing dependencies:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">1.\u00a0 \u00a0 The first method is more simple and can be used when getting started. Run this command in your public_html directory:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer require <\/span><span style=\"font-weight: 400;\">&lt;module&gt;<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">e.g. <\/span><i><span style=\"font-weight: 400;\">composer require monolog\/monolog<br \/>\n<\/span><\/i><i><\/i><span style=\"font-weight: 400;\">This will install the module and its dependencies into your current folder and create a file &#8220;vendor\/autoload.php&#8221; \u00a0which can then be included in your code to give access to the dependency<\/span><br \/>\n<span style=\"font-weight: 400;\">2.\u00a0 \u00a0The second way to install dependencies is to use a provided composer.json file (often included with software such as some WordPress installers) or to create your own. \u00a0A more detailed explanation can be found <\/span><a href=\"https:\/\/getcomposer.org\/doc\/01-basic-usage.md\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">here.<\/span><\/a><\/p>\n<h3><span style=\"font-weight: 400;\">To obtain information about installed dependencies:<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">To get information about dependencies installed by Composer, simply run:<br \/>\n<\/span><i>composer info<\/i><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">To uninstall dependencies:<\/span><\/h3>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Run this command:<br \/>\n<\/span><\/p>\n<pre><i>composer remove <\/i>&lt;module name&gt;<\/pre>\n<p>e.g. <i>composer remove monolog\/monolog<\/i><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false,"plain":"<span >Composer is a dependency management tool for PHP. It allows you to manage the libraries your project depends on and runs updates on these dependencies for you. <\/span><span >\r\n<\/span><span >\r\n<\/span><span >Composer is now installed on all Managed Servers and uses the PHP configuration and version specified in the <\/span><a href=\"https:\/\/xneelo.co.za\/help-centre\/control-panel\/what-directives-can-be-changed-php-config-tool\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span >PHP Config tool<\/span><\/a><span > in your Control Panel. <\/span>\r\n\r\n<span >This is a more modern approach to package management and is s<\/span><span >trongly inspired by Node's <\/span><a href=\"https:\/\/www.npmjs.com\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span >npm<\/span><\/a><span > and Ruby's <\/span><a href=\"https:\/\/bundler.io\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span >bundler<\/span><\/a><span >. More information on Composer usage can be found <\/span><a href=\"https:\/\/getcomposer.org\" target=\"_blank\" rel=\"noopener noreferrer\"><span >here<\/span><\/a><span >.<\/span>\r\n<h3><span >You can choose between two methods of installing dependencies:<\/span><\/h3>\r\n<span >1.\u00a0 \u00a0 The first method is more simple and can be used when getting started. Run this command in your public_html directory:<\/span>\r\n<pre><span >composer require <\/span><span >&lt;module&gt;<\/span><\/pre>\r\n<span >e.g. <\/span><i><span >composer require monolog\/monolog\r\n<\/span><\/i><i><\/i><span >This will install the module and its dependencies into your current folder and create a file \"vendor\/autoload.php\" \u00a0which can then be included in your code to give access to the dependency<\/span>\r\n<span >2.\u00a0 \u00a0The second way to install dependencies is to use a provided composer.json file (often included with software such as some Wordpress installers) or to create your own. \u00a0A more detailed explanation can be found <\/span><a href=\"https:\/\/getcomposer.org\/doc\/01-basic-usage.md\" target=\"_blank\" rel=\"noopener noreferrer\"><span >here.<\/span><\/a>\r\n<h3><span >To obtain information about installed dependencies:<\/span><\/h3>\r\n<ul>\r\n \t<li ><span >To get information about dependencies installed by Composer, simply run:\r\n<\/span><i>composer info<\/i><\/li>\r\n<\/ul>\r\n<h3><span >To uninstall dependencies:<\/span><\/h3>\r\n<ol>\r\n \t<li ><span >Run this command:\r\n<\/span>\r\n<pre><i>composer remove <\/i>&lt;module name&gt;<\/pre>\r\ne.g. <i>composer remove monolog\/monolog<\/i><\/li>\r\n<\/ol>\r\n&nbsp;"},"excerpt":{"rendered":"<p>Composer is a dependency management tool for PHP, allowing you to manage the libraries your project depends on. <\/p>\n","protected":false},"author":23,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"lsx_disable_title":"0","_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","footnotes":""},"categories":[219],"tags":[],"topics":[],"class_list":["post-27148","post","type-post","status-publish","format-standard","hentry","category-managing-dedicated-hosting"],"acf":[],"additional_meta":{"category_title":[{"term_id":219,"name":"Managing your Dedicated Hosting","slug":"managing-dedicated-hosting","term_group":0,"term_taxonomy_id":219,"taxonomy":"category","description":"Managing Dedicated Hosting","parent":207,"count":8,"filter":"raw","term_order":"90","cat_ID":219,"category_count":8,"category_description":"Managing Dedicated Hosting","cat_name":"Managing your Dedicated Hosting","category_nicename":"managing-dedicated-hosting","category_parent":207}],"tag_title":false},"featured_image_src":null,"author_info":{"display_name":"janine.g","author_link":"https:\/\/xneelo.co.za\/help-centre\/author\/janine-g\/","author_avatar":"https:\/\/secure.gravatar.com\/avatar\/60563272a8fc98e284410c640884d1e02e7271b28f06b7526c5f7dd877cb33f9?s=96&d=mm&r=g"},"_links":{"self":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts\/27148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/comments?post=27148"}],"version-history":[{"count":0,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/posts\/27148\/revisions"}],"wp:attachment":[{"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/media?parent=27148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/categories?post=27148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/tags?post=27148"},{"taxonomy":"topics","embeddable":true,"href":"https:\/\/xneelo.co.za\/help-centre\/wp-json\/wp\/v2\/topics?post=27148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}