Deploy Laravel 5 to /htdocs

Premium hosting doesn’t have most of those things either. They do have Git deploys, but not command line access or a good way to run Mix/Webpack.

If you want all of those things, I’d recommend a VPS or an application hosting platform like Heroku or Cloudways. The InfinityFree client area (also built with Laravel) is runs on VPS, where it can use things like Queue workers, Redis and Deployer to use more advanced features.

You’re making it unnecessary complicated for yourself.

Just follow the instructions I gave above. Upload the Laravel installation to your htdocs folder and add the .htaccess file I provided as-is to the main folder of the application.

Don’t flatten the public directory, don’t edit the index.php and don’t edit the .htaccess file provided by Laravel. The .htaccess file abuses rewrite rules to create a “fake” document root change. That way, you can keep the entire Laravel directory structure as-is.

So the setup is:

  1. Upload Laravel code to htdocs folder including Composer vendor folder and prepared static files.
  2. Add .htaccess file to htdocs folder.
  3. Create database and import dump.
  4. Update settings in .env file.
  5. Live happily ever after.

The database can be created through the MySQL Databases section in the control panel, not phpMyAdmin. Since you can’t run migrations and seed scripts from the command line, it’s probably best if you run those on your own computer, dump the database there and import it here.

2 Likes