0

I have developed a system in Laravel 5 and it works fine with "/public" after the main domain.But i needed to access the site with a clean URL without adding "/public" after the domain.Therefore i moved public folder's content to the root of the server and kept other content inside a separate folder as mentioned in the tutorial which i followed.

Then i changed the relevant paths in index.php. But now it's giving me an "Whoops, looks like something went wrong." error.

I saw a similar question in stackoverflow and i followed those steps.But still it's same.

ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
CodeCanyon
  • 929
  • 2
  • 11
  • 36
  • enable debug =true, and post your error, then I could help, and if you're hosting on a VPS then dont hack the core files, just point your domain name to public folder in server.conf – msonowal Jan 08 '17 at 15:49
  • It's already in debug=true.It's a hostgator shared server so i don't have any privileges to point to public folder.Sure i will post my error here. – CodeCanyon Jan 08 '17 at 16:01
  • @msonowal - last 2 lines of error log #56 /home2/laraveluser/public_html/laravel/vendor/compiled.php(1880): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #57 /home2/laraveluser/public_html/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) – CodeCanyon Jan 08 '17 at 16:17
  • I suggest instead of moving the contents of the public directory, create a configuration that will set the root directory to the public directory of laravel: if you are using apache you could use .htaccess, if you are using nginx you could modify your specific config for your sites. – Dominick Navarro Jan 09 '17 at 04:35
  • What is the tutorial you followed? What is the similar question on SO? – Don't Panic Jan 09 '17 at 04:50
  • @DominickNavarro- I'm using hostgator's apache shared server.And i tried with a .htaccess file as well.But still not working.Yes i saw config thing as well.If you're saying so i will try with that too.I came up with mentioned solution since most of the people have mentioned that's as a success method. – CodeCanyon Jan 09 '17 at 06:14
  • @Don'tPanic - I followed a tutorial which was mentioned in Laracasts.And i can't find the SO question.But i'm sure there was a question relating to this and it has marked as a duplicate one.So i followed both and still this issue occurs. – CodeCanyon Jan 09 '17 at 06:29
  • @Don'tPanic - I found this link on SO which is very similar to the tutorial that i followed - http://stackoverflow.com/questions/19923091/avoid-public-folder-of-laravel-and-open-directly-the-root-in-web-server – CodeCanyon Jan 09 '17 at 06:31
  • Now i can see this error, "PDOException in Connector.php line 47: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)".It seems the server is getting my localhost credentials of the database.But i'm 100% sure i changed them in .env file correctly to the server db credentials.Then logged into the server with SSH and changed the storage folder's permission to 777 as well. – CodeCanyon Jan 14 '17 at 05:46
  • Another thing which i noticed is, online sever showing an error which is related to localhost path.I'm confused with this.This is the error, "ErrorException in compiled.php line 6195: file_put_contents(C:\xampp\htdocs\laravelsite\storage/framework/sessions/0542689f28f88dc42fa24157896dee62bde734d9c1): failed to open stream: No such file or directory" – CodeCanyon Jan 15 '17 at 04:29

0 Answers0