1

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.

2
  • what version of Php do you use? Commented Mar 5, 2017 at 8:49
  • test a simple raw php file. it's not your laravel problem. Commented Mar 5, 2017 at 8:52

4 Answers 4

3

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]
Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

1

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.

Comments

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.