Set Up Laravel 5 on Shared Hosting (c-panel)? Hi, I have to upload the laravel for the web site. So, i uploaded the app folder to public_html. But, it doesn't work. Please help me, to solve that problem.
Hi, @davidrushton.
Thz u for your sharing, i ask the hosting services to access SSH shell access of c-panel.
Thank u for your kind.
500 Internal Server Error, still get the error. Why, all bros?
This is what I did for one of my projects:
Upload all the files inside public -> public_html
Create a directory in / and name it laravel or whatever is more convenient for you:
So that the directory structure becomes similar to
cgi-bin Directory ....
laravel Directory ....
public_html Directory ....
......
Upload all the other directories/files (config, app, ...) to laravel.
Update public_html/index.php:
// ...
require __DIR__.'/../laravel/bootstrap/autoload.php';
// ...
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
Update public_html/.htaccess and add at the bottom:
RewriteEngine On
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_URI} !^
RewriteRule ^(.*)$ /$1 [L]
Update .env to your new server settings.
Import your mysql tables.
This is working 100% for me.
Hi @moharrum ,
This is .htaccess in public_html. Did u remove the files in app\public folder?
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !^
RewriteRule ^(.*)$ /$1 [L]
# 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}]
</IfModule>
Please sign in or create an account to participate in this conversation.