Using Composer

jayw1

Verified User
Joined
Nov 20, 2019
Messages
205
Location
USA
I want to try using the forum software known as Flarum.
Here is the install guide: https://flarum.org/docs/install.html#server-requirements

Does DirectAdmin come packaged with Composer?
For installation, would I just create the domain, navigate to /home/user/domains/domain.com and run the Composer command? Do I run Composer as root?

Thanks!
 
Composer is normally not installed by default, but if you are using Custombuild there is maybe a way to have it installed.
I recently got a message in Custombuild that there is an update for Composer, see this topic.

What I do nowadays is running the Composer command as the user itself.
So something like:
Bash:
sudo -u user /usr/local/bin/composer require package

Like this the files are owned by the given user and else this would be like root.
 
Composer is normally not installed by default, but if you are using Custombuild there is maybe a way to have it installed.
I recently got a message in Custombuild that there is an update for Composer, see this topic.

What I do nowadays is running the Composer command as the user itself.
So something like:
Bash:
sudo -u user /usr/local/bin/composer require package

Like this the files are owned by the given user and else this would be like root.

User as in DirectAdmin user? I have only one and that's admin.
 
User as in DirectAdmin user? I have only one and that's admin.
If that's your only user then yes. So your domain should also be under user then and the path to the domain should also be something like /home/admin/domains/domain.com
 
If that's your only user then yes. So your domain should also be under user then and the path to the domain should also be something like /home/admin/domains/domain.com

Yep, same as all the others.
So I would install composer, create the domain, navigate to the directory and run

composer create-project flarum/flarum . --stability=beta

That's it?
 
Just did the test myself and for me it worked like this:
cd /home/user/domains/domain.com/public_html made it empty sudo -u user /usr/local/bin/composer create-project flarum/flarum . --stability=beta

Why I'm adding the full path of composer, in my case when using a DA user it does not know where "composer" is.
Just be sure that you have >= PHP 7.1 (as default), if not add the path of something which is >= PHP 7.1 before the composer command.

Then what I saw after installing is that a public is created which in fact in your case you will expect this as the public_html that you want in DA.
So I mean with this that after installation you need to complete the setup by going to domain.com/public.
Would be good that you check the docs how you can have this changed.
Don't know if moving all the folders expect the public one, on the same level as public_html, and then moving the files from public one level lower will do the trick.

That's all where I can help you with.
 
Installation of composer is as simple as:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build composer
I've followed the instruction, installed but after calling "composer --version" or just "composer" it displays nothing / no output
 
Just fixed the Composer issue by rebuilding the php to the latest 7.4 versions as a first instance
 
Back
Top