psudo
psudo

Reputation: 1558

Setup laravel in shared hosting

I'm trying to setup laravel (5.4.12) in shared hosting. Following this tutorial I had deleted my public_html and created soft-link for public_html to public folder of laravel project. I had successfully setup laravel (5.3.29) following the same tutorial for my previous project. But this time when I try to open base url it downloads index.php file of public directory of laravel folder. Can anyone help me out.

Upvotes: 1

Views: 2844

Answers (4)

lkdhruw
lkdhruw

Reputation: 582

You can do it without deleting public_html folder.

for routing to public forlder just add these lines to .htaccess files

RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

Upvotes: 3

psudo
psudo

Reputation: 1558

Finally found the solution. The issue was with PHP version. I had selected PHP version 7.1.0RC4,I changed it to 7.0.12 and the problem is gone.

Upvotes: 1

FatBoyXPC
FatBoyXPC

Reputation: 951

Normally PHP files are downloaded when the web server isn't configured to serve PHP files. Sounds like you need to talk to your hosting provider.

Upvotes: 1

Aman Kumar
Aman Kumar

Reputation: 4547

Laravel 5 setup without artisan serve command

  • Rename the server.php in the your Laravel root folder to index.php

  • copy the .htaccess file from /public directory to your Laravel root folder.

Upvotes: 0

Related Questions