How to Install Composer and Laravel 5 in cPanel

How to Install Composer and Laravel 5 in cPanel

composer on shared hosting

Do you need to know how to install Laravel 5 in a cPanel account?

In this tutorial, I walk you through installing Composer and Laravel 5 in a cPanel account. This can be done on any cPanel account, including shared hosting. Start your next PHP Project using one of the best frameworks out there.

Two things to note is that this should be followed on an empty account, or make sure you back up your public_html folder before proceeding because you will lose everything in this folder. You will also need SSH access. If you are on a shared hosting account and you do not have SSH access, please contact your host prior to following this tutorial. Once you have access, download PuTTY and login to your account.

Ignore every time I say public.html or public/html, I mean public_html or just basically “public html.”

Have any questions? Feel free to ask.

Remember to visit for the rest of my tutorials (including a version of this tutorial). If you find this tutorial helpful, please like and share.

Thanks for watching, remember to subscribe!

#Laravel #Composer #cPanel

Visit my website:
Subscribe on YouTube:
Support me on Patreon:
Follow me on Twitter:
Like me on Facebook:
Check out my Github:

29 thoughts on “How to Install Composer and Laravel 5 in cPanel

  1. Still works 5 years later 🙂
    I am curious though how I would need to go about keeping the front-end of the website as the wordpress site we've already made and the laravel project as the web app part of it.
    At this point I just copied the original folder that was public_html and called it something arbitrary like backups so any information on incorporating the wordpress stuff back in would be helpful! I've never dealt with WP so I am not even sure if its as simple as telling WP "Hey point to this folder instead" or if the WP stuff needs to also go into our public folder inside the laravel folder.

  2. You can also use htaccess to change which folder is the root folder, or just change which folder the domain points to in the domain settings of cPanel.

  3. How come I couldn't run PHP into my remote shell every time I type php installer –check ?

    Here is the message :
    Can't locate in @INC (you may need to install the ea_php_cli module) (@INC contains: /var/cpanel/ea4 /home/myUsername/perl5/lib/perl5 /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5.28.0/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5.28.0 /opt/cpanel/perl5/528/site_lib/x86_64-linux-64int /opt/cpanel/perl5/528/site_lib) at /usr/local/bin/php line 17.

    BEGIN failed–compilation aborted at /usr/local/bin/php line 17.

  4. This video was really helpful
    can you please make a video on how to install node/npm in cpanel
    so we can install the dependencies and packages related to laravel

  5. Thanks for this video. It should be helpful to me. My only concern is why you indicated the need to do this in a unused hosting account. Why not just put in a subdirectory. So, your soft link to "public_html" could be to "public_html/subdir". You'd have no need to do the scary command "rm -rf". Someone could test things out in a subdirectory, and if all works well, move to the main.

  6. Hi, I want to host my laravel website inside public_html/test_project, I want to keep the whole laravel project under "test_project", If It is possible, Please help me for this. Thanks

  7. hello sir i follow the whole steps corectly every thing is done fine on putty but at the end while i refresh browser i got http error 500 please tell me what i m missing

  8. I have a problem when creating a symlink public_html points to laravel/public – HTTP ERROR 500. But when I just symlink public_html to laravel/ and use it works. Please help me! I use SSH in AWS VPS and install Vestacp. Thank you very much!

Leave a Reply

Your email address will not be published. Required fields are marked *