petehouston/laravel-deploy-on-shared-hosting

Laravel Shared Hosting Issue

Closed this issue · 5 comments

@petehouston
I followed all the procedures step by step (without composer as my hosting platform doesnt allow ssh) but only my homepage loads. The other links are broken(returns 404) and the website doesnt load and files from the css or js folders. The logo image in the img folder, however, loads.

Edit: The logo image on the homepage isnt being pulled in again.

Here is what I did:

  • I zipped the laravel app folder on my local machine and uploaded it to the root of my server
  • then I unzipped it, renamed it appropriately (app folder) and then moved the folder into my public_html folder
  • then I moved the index.php and the .htaccess files (only them) from the app/public folder into the public_html folder
  • I configured the index.php file to point to the appropriate folders
    require __DIR__.'/app/bootstrap/autoload.php'; and
    $app = require_once __DIR__.'/transcorpexpress/bootstrap/app.php';
  • I then changed the permissions of the app/storage folder to 777 and that off app to 777

What are my doing wrong or missing? Please help me as soon as possible.
Thank you very much :)

This is my .htaccess file (in the publi_html folder)

`

Options -MultiViews

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

`

what is current project directory structure on server?

/Public_html/app

@petehouston

Hello, I know you're busy but I really really need to fix this issue ASAP

Assuming your home path is: /home/transcorpexpress,

  • Create a directory for project, ex. /home/transcorpexpress/code
  • Copy everything in /home/transcorpexpress/code/public to /home/transcorpexpress/public_html , don't forget those hidden files.
  • Change permission /home/transcorpexpress/code/storage to 0777 (recursively)
  • Update content inside /home/transcorpexpress/public_html/index.php to load correct path to project file.
  • In source code, make sure to use asset().

If there is any error, feel free to share it here. Also check out the server error log, storage/logs/laravel.log to see what needs to be fixed.