Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable error reporting in Laravel?

I'm using Laravel 5.2 and I'm trying to import an excel sheet which contains more than 18000 records. the error below appeared. The localhost page isn’t working

localhost is currently unable to handle this request.
HTTP ERROR 500

I tried to change php.ini max_execution_time from 30 seconds to 300 seconds but nothing has been changed

EDIT

the apache error log file says: [:error] [pid 3680:tid 1724] [client ::1:54491] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in E:\..............

like image 596
Mohamed Shawky Avatar asked Mar 07 '17 12:03

Mohamed Shawky


People also ask

How do I enable php error reporting?

The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

How do I disable error reporting in Laravel?

You may turn off error details by setting the debug option in your app/config/app. php file to false .

How do I enable logging in Laravel?

Laravel supports different logging modes like single, daily, syslog, and errorlog modes. You can set these modes in config/app. php file. You can see the generated log entries in storage/logs/laravel.


2 Answers

through your config/app.php set 'debug' => env('APP_DEBUG', false), to true

or in a better way , check out your .env file and make sure to set the debug element to true .

EDIT

according to the error in your apache2 log

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes)

you need to increase your memory limit

ini_set('memory_limit', XXX);
like image 101
hassan Avatar answered Sep 23 '22 15:09

hassan


ini_set('max_execution_time', 0);

set this at the start of your script, this will run your script forever and check your ipv4 address.

like image 25
Sweta Parmar Avatar answered Sep 24 '22 15:09

Sweta Parmar