How do I install the Laravel framework?
Laravel can be installed on any Hawk Host shared hosting server, but you’ll first need to set up Composer, which you can do using our guide: How do I add Composer to my hosting account?
Installing Laravel
Section titled “Installing Laravel”Once Composer is installed, you can install Laravel using the following command:
composer create-project laravel/laravel my-projectThis will create a new Laravel project in the my-project directory.
Configuring Primary Domain to Load Laravel Project
Section titled “Configuring Primary Domain to Load Laravel Project”Unfortunately, cPanel does not allow you to modify the document root of your primary domain. We can, however, use symbolic links so that your Laravel project’s public folder is used.
To do this, you’ll need to create a symbolic link from your primary domain’s document root to your Laravel project’s public folder.
For example, if your Laravel project is located at /home/username/my-project, you would create a symbolic link from /home/username/public_html to /home/username/my-project/public.
Rename Existing public_html folder
Section titled “Rename Existing public_html folder”mv ~/public_html ~/public_html_backupCreate Symbolic Link
Section titled “Create Symbolic Link”ln -s ~/my-project/public ~/public_htmlConfigure Addon Domain to Load Laravel Project
Section titled “Configure Addon Domain to Load Laravel Project”To configure an addon domain to load your Laravel project, when creating your domain, set the document root to the public folder of your Laravel project. You can use our guide How to create new domains, addon domains, parked domains, and subdomains on how to create your addon domain.
Example Configuration
Section titled “Example Configuration”Domain: example.com
Document Root: my-project/public