laravel logo

How to create a website with Laravel and deploy it to a shared hosting account

Laravel is a platform that can be installed using Composer just like Symfony or Code Igniter. Since shared hosting accounts don’t provide SSH access you need to do this locally on your computer. To do that, you need to start by downloading the latest PHP version (and add the path to the PHP executable file to the PATH variable of the operating system you are using). The next step is downloading and setting up of the Composer.

Once you are done with these steps, you need to run the following command in a command prompt:

composer create-project –prefer-dist laravel/laravel projects-name

When this is done you will need to update the .env file with all the info required by your project (like database information). In order to be able to access the installation within the browser, you will need to add an .htaccess file with the following content:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_URI} !public/
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Next on the list would be the authentication system that can be setup by using the following commands:

composer require laravel/ui

php artisan ui vue –auth

(you can replace here ‘vue’ with ‘bootstrap’ or ‘react’ as you may need)

Now you have a basic Laravel installation that you can upload to your shared hosting account.

 

Leave a Comment

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