Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The method for deploying a Laravel 8 application on shared hosting (cPanel) in the absence of SSH is as follows:

  1. Upload your Laravel application files through FTP to the root directory of your shared hosting account.

  2. Create a new MySQL database and user through cPanel's MySQL Database Wizard.

  3. Configure the database settings in the Laravel .env file according to the database name, user, and password you created in step 2.

  4. Set file permissions for Laravel's storage folder to 775 or 777 to ensure Laravel can write to the folder.

  5. Change the document root of your domain to the public folder of your Laravel application.

  6. Modify the .htaccess file in the public folder by adding the following code to prevent access to specific file types:

    <FilesMatch "\.(env|json|config.js|config.php|git)">
        Order deny,allow
        Deny from all
    </FilesMatch>
    
  7. Finally, visit your domain to ensure the Laravel application is properly deployed and configured.

Note: Without SSH access, you may not be able to use some advanced deployment methods that require command line access, such as using Git for deployments or installing Composer packages directly on your server.