716 Views
To install Laravel 5.2 on a shared or reseller hosting environment, follow these steps:
- Access your hosting account:
Log in to your hosting control panel provided by Infinitive Host. - Create a new directory:
Navigate to the directory where you want to install Laravel or create a new one. You can usually do this through the file manager in your hosting control panel. - Upload Laravel files:
Download Laravel 5.2 from the official website. Extract the files on your local machine and then upload them to the directory you created in step 2 using an FTP client or through the file manager in your hosting control panel. - Set permissions:
Set the appropriate permissions for Laravel directories. Typically, you’d set the storage and bootstrap/cache directories to be writable by the web server. This can usually be done via your FTP client or through your hosting control panel. - Create a database:
In your hosting control panel, create a new MySQL or MariaDB database for your Laravel application. Make sure to jot down the database name, username, and password for future reference. - Configure environment variables:
In the root directory of your Laravel installation, you’ll find a file named.env.example
. Duplicate this file and rename it to.env
. Edit the.env
file and update the database connection settings with the details of the database you created in step 5. - Install Composer dependencies:
Laravel uses Composer to manage its dependencies. If Composer is not installed on your server, you can follow the instructions on the Composer website to install it. Once Composer is installed, navigate to your Laravel installation directory via SSH or the command line and runcomposer install
to install the required dependencies. - Generate application key:
While still in the Laravel root directory, run the commandphp artisan key:generate
. This will generate a unique application key and update your.env
file with it. - Run migrations (optional):
If your application requires a database schema, you can run migrations by executingphp artisan migrate
from the command line in your Laravel root directory. This action will generate the essential tables within your database. - Set up cron jobs (optional):
If your Laravel application uses scheduled tasks, you’ll need to set up a cron job to execute the Laravel scheduler every minute. Insert the following entry into your server’s crontab:* * * * * php /path-to-your-laravel-installation/artisan schedule:run >> /dev/null 2>&1
- Test your installation:
Finally, navigate to your domain in a web browser to see if Laravel is installed correctly. If everything was set up properly, you should see the Laravel welcome page.
That’s it! You’ve successfully installed Laravel 5.2 on your shared or reseller hosting environment.