Ask Your Question
1

What is the method for deploying a Laravel 8 application on shared hosting (cPanel) in the absence of SSH?

asked 2022-12-16 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-06 21:00:00 +0000

woof gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-12-16 11:00:00 +0000

Seen: 25 times

Last updated: Oct 06 '21