1

Recently,I just installed a chat package called Easychat. At first, it worked perfectly. I don't why but today I'm facing a problem where It said as in the pic enter image description here

In the console it also said: Failed to load resource: the server responded with a status of 500 (Internal Server Error)

The weirdest thing is that when I go to Route file and change the URI from easychat to something different like easychat222 just for testing.

From

Route::get('/easychat', [
 'as' => 'chatnow',
 'uses' => 'EasychatController@getIndex'
]);

To

Route::get('/easychat222', [
 'as' => 'chatnow',
 'uses' => 'EasychatController@getIndex'
]);

and refresh the page. It works perfectly with the old uri (easychat) not with the new one. Anybody knows what is the problem here and please tell me how to fix it. Thank you very much!

Huy Le
  • 339
  • 1
  • 2
  • 11

1 Answers1

0

You're using wrong web server configuration. You should point web server to a public directory inside Laravel directory and restart it.

Change these lines in Apache config file (if you're using Apache):

For Apache you can use these directives:

DocumentRoot "/path_to_aravel_project/public"
<Directory "/path_to_aravel_project/public">

For nginx:

root /path_to_aravel_project/public;
Community
  • 1
  • 1
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
  • What do you mean by wrong web server configuration? I'm using Xampp and all of my projects I placed inside htdocs folder. It seems to work fine. – Huy Le May 30 '16 at 09:56
  • Your configuration can cause 500 error. This configuration is correct for WP and similar software, but when you're using Laravel, you should modify virtual host configuration. After doing that you'll need to use normal URLs like `http://localhost.com:8080/easychat` instead of `http://localhost.com:8080/chat/public/easychat` – Alexey Mezenin May 30 '16 at 10:07
  • I did as you said but when I access to my project folder and `NotFoundHttpException in RouteCollection.php line 161:` appeared. – Huy Le May 30 '16 at 10:21
  • Are you sure you made it all right? Did you restart web server after you made changes? If you're not sure, please show me VH configuration. If your configuration is now correct, check registered routes with `php artisan route:list` command (screenshot of related route will be helpful). – Alexey Mezenin May 30 '16 at 10:40
  • Ok, just forget my comment above. here is what I did and the result too. Open xampp and change the **Document root** path and **directory** path and restart web server. However I still get the same problem `[ReflectionException] Class App\Http\Controllers\EasychatController does not exist` – Huy Le May 30 '16 at 10:53