1

I have installed Laravel 5 and got to display the welcome page. But haven't been able to display any other page. I have installed with following settings:

In /etc/apache2/sites-available/laravel.example.com.conf

DocumentRoot   /var/www/laravel/public

In /var/www/laravel/app/Http/routes.php

// ---- THIS DOESN'T WORK
Route::get('/simple', function () {
    return View::make('simple');
});

// ---- THIS WORK FINE
Route::get('/', function () {
    return View::make('welcome');
});

In /var/www/laravel/public

$ ls -> index.php   robots.txt   web.config

In /var/www/laravel/resources

$ ls -> errors   vendor   simple.blade.php   welcome.blade.php
// welcome.blade.php -> gets displayed
// simple.blade.php -> doesn't get displayed
Laerte
  • 7,013
  • 3
  • 32
  • 50
dvlper
  • 462
  • 2
  • 7
  • 18

4 Answers4

0

Have you tried php artisan command from command prompt.

php artisan route:cache

We have to run this command after adding new route.

manish
  • 181
  • 1
  • 4
  • do I need to specify complete path of route.php and alter command like: **php artisan /app/Http/route:cache** – dvlper Mar 10 '16 at 14:55
  • no, just run the command after going inside your laravel project. if your project path is /var/www/html/laravel-project, Then go to /var/www/html/laravel-project in command prompt and run the command. – manish Mar 10 '16 at 14:58
  • Didn't worked it shows: Route cache cleared! [LogicException] Unable to prepare route [simple] for serialization. Uses Closure. – dvlper Mar 10 '16 at 15:02
0

The mod_rewrite enabled?

The .htaccess file good?

0

sudo a2enmod rewrite In your apache configuration file(apache2.conf) change AllowOverride None to AllowOverride All

Then restart apache using:: sudo service apache2 restart

// change the group of project/app/storage to www-data and change folder permission too $ sudo chmod -R gu+w app/storage

dpak005
  • 241
  • 4
  • 10
-1

/simple route may be missing. Check it with "welcome" template first. Chmod 777 to cache as well. Hope, it is not related to case sensitive file names.

Bimal Poudel
  • 1,214
  • 2
  • 18
  • 41
  • `chmod 777` -> nonononono! Never ever run `chmod 777`. It is practically never required! Not even for "testing purposes". If the file is readable, then it's readable. If it's writable by the `user` or `group` that need to write to it, then it's writable. There is absolutely zero need to give everyone write permissions, and forgetting to `chmod` it back to something sane is exactly how multinationals get hacked. Just don't do it. Ever. I wrote [an introduction of Unix permissions](http://stackoverflow.com/a/35895436/660921). Please read it! – Martin Tournoij Mar 13 '16 at 04:11