Apache serves up a blank page

I created one sample PHP script to load excel sheets with very large dimensions. Also the process going on with each record listed in excel sheets is complex. To allow for larger sizes, I added the required PHP ini values ​​in the Apache config file to override the actual PHP ini values.

The problem is that once I upload large files it takes longer, say 2 minutes or so, after which I see a blank page instead of a results page. When I was linking Apache logs, I did not see any lines like this associated with this issue.

Just wanted to know if there are any cases / possibilities where Apache might show a blank page?

But when I was linking the application level logs, it is very clear that the script exits fine. Perhaps my suspect could happen as soon as the job finishes, while Apache is about to return the results page, something would happen, but I'm not sure about that.

+1


source to share


5 answers


I am assuming this is not an Apache bug and your browser is simply disconnecting the connection. You can try some of these methods and see if it helps anyone.



+2


source


Is it possible than "else" rather than handle the suitcase properly? You can assume the file was uploaded successfully, but that doesn't necessarily mean it did. Have you only increased "upload_max_filesize" as well as "post_max_size" (total sum of all your forms: text input + files)?

Try adding the following at the top of your script to see any errors or warnings PHP might show.



error_reporting(E_ALL);

      

+1


source


If it takes a while to process the request / upload, you might want to create a queue where the user knows the file was uploaded successfully and should just wait (maybe check the status on the page); and you have a cronjob / background process to convert files and update them. So it doesn't scare the user's time.

0


source


Sounds like a memory problem, try increasing memory_limit or optimizing your memory usage

Outputs memory errors / segfaults to blank pages and missing log information.

0


source


There are two things you can do to avoid this problem.

  • Ask the user to convert the excel file to csv if possible in your situation. as csv is much easier than excel sheet.
  • try using the header ("newpage.php") in your script to redirect the user to a new page
-1


source







All Articles