7

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:\..............

8
  • What's the error log show? Commented Mar 7, 2017 at 13:02
  • Check laravel logs if not then check apache logs.... Commented Mar 7, 2017 at 13:09
  • 1
    "500 Internal Server Error" (or a blank page) means your script is throwing an error but PHP is configured to hide it from you. You need to fix it ASAP because coding without the aid of error messages is hard. As quick start, you can set the error_reporting and display_errors directives in your computer's system-wide php.ini file (details here). However, Laravel should have its own error reporting features—make sure you check them out in their documentation. Commented Mar 7, 2017 at 13:12
  • the appache 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:\\.............. Commented Mar 7, 2017 at 13:21
  • you may need to increase your memory limit . Commented Mar 7, 2017 at 13:25

3 Answers 3

17

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);
Sign up to request clarification or add additional context in comments.

3 Comments

where I can find ini_set please?
inside your method , be careful and change XXX to a valid value , check out more details about this in the manual
changing in .env helped a lot especially if it is under gitignore, you wouldn't have worries of accidentally committing it to the repo.
2

in .env file change APP_DEBUG to true

APP_DEBUG=true

Comments

1
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.

2 Comments

at the beginning of your script
did you set your "debug" = true?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.