1

I installed a new fresh project Laravel 5. It worked on local, but not working on server (CentOS 7, LAMP). I installed the server as required by Laravel:

  • PHP >= 5.5.9
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • Mod_rewrite enabled

I executed CHMOD 777 to storage folder. When i run project on browser, nothing displays. Looking in the console tab, it shows "Failed to load resource: the server responded with a status of 500 (Internal Server Error)".

Content of error_log file

[Mon Jul 27 12:45:20.618306 2015] [core:notice] [pid 1448] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0 [Mon Jul 27 12:45:20.681536 2015] [suexec:notice] [pid 1448] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this messa$ [Mon Jul 27 12:45:20.751429 2015] [auth_digest:notice] [pid 1448] AH01757: generating secret for digest authentication ... [Mon Jul 27 12:45:20.753167 2015] [lbmethod_heartbeat:notice] [pid 1448] AH02282: No slotmem from mod_heartmonitor [Mon Jul 27 12:45:24.458038 2015] [mpm_prefork:notice] [pid 1448] AH00163: Apache/2.4.6 (CentOS) PHP/5.6.11 configured -- resuming normal operations [Mon Jul 27 12:45:24.458129 2015] [core:notice] [pid 1448] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Mon Jul 27 12:53:02.593593 2015] [:error] [pid 2558] [client 192.168.56.1:56015] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file$ [Mon Jul 27 12:53:02.663948 2015] [:error] [pid 2558] [client 192.168.56.1:56015] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file$

Please help me. Thanks!

UPDATE: I do have a APP_KEY and the APP_DEBUG is also set to true. but im not getting the Views. I just Tried echo a string in the routes.php .

Route::get('/', function () { echo 'test'; return view('welcome'); });

I can see the word 'test' but not the view..

p/s: All folder in storage and bootstrap/cache ar writeable (CHMOD 777)

DONE: i'm disable SELinux on my server and this problem has been resolved :D Thanks all

James
  • 15,754
  • 12
  • 73
  • 91

2 Answers2

0

A few checklist items for you:

  1. First, check the log file in storage/logs -- this usually has the answer.
  2. Check the apache log file.
  3. Make sure any subfolders in storage are also writable by the web server.
  4. Be sure you've installed the mcrypt extension -- this one always trips me up.
  5. Make sure you've run composer install to install Laravel's requirements.
  6. Make sure to set your app key with php artisan key:generate
  7. Add die('test'); to line 1 of public/index.php to verify apache is configured correctly.
Ben Claar
  • 3,285
  • 18
  • 33
  • Thank you Ben, i'm sure any subfolders in storege ar also writeable by the webserver. However, there a no files in storage/logs :(. And i'm sure try all your solution recommended. But the problem has not been resolved :( – Đoàn Nguyễn Jul 27 '15 at 04:34
  • @Ben i have no problems without mcrypt extension installed. 5.1. interesting why... especially if it is defined in official documentation as "must be" – M0rtiis Jul 27 '15 at 04:48
  • Anything in apache's log file? – Ben Claar Jul 27 '15 at 04:49
0

Have you create the .env file and set your APP_KEY? Also, you can enable debuging by adding APP_DEBUG=true to your .env file.

Romain Lanz
  • 825
  • 5
  • 13