Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7726899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:19:34+00:00 2026-06-01T05:19:34+00:00

I was debugging a situation last night where running lighttpd and fastcgi was causing

  • 0

I was debugging a situation last night where running lighttpd and fastcgi was causing a 500 error when I was uploading files. A closer inspection showed that files were indeed being uploaded, and even saved to the Mongo database back-end, but it was still throwing a 500 error.

So today I switched over to apache, which we have had working on another system, yet the error still occurs, and instead an ’empty response’ is presented. After a bit of investigation, I found that it appears to happen when saving the file to the Mongo database. My code is as follows:

$file = File::create();
$file->save(array('file'=>$data['file']));

It appears to be fine when creating the file, however on saving the file data, it seems to go into the database without issue, but I don’t think it returns properly. Looking at the mongo logs, this appears after every database save:

run command my_db.$cmd { getlasterror: 1 }

So it would appear that the issue lies with MongoDB throwing some form of error when a file is saved to GridFS – has anyone come across such an issue before that might interfere with PHP causing it to essentially crash?

Thanks,

Dan

(Just to mention – I am using the Lithium PHP Framework, and the 64-bit version of MongoDB).

Update:

Just to be more thorough with whats happening, when running lighttpd I get this error on upload:

2012-03-24 13:14:42: (mod_fastcgi.c.2566) unexpected end-of-file (perhaps the fastcgi process died): pid: 21279 socket: unix:/tmp/php.socket-1 
2012-03-24 13:14:42: (mod_fastcgi.c.3354) response not received, request sent: 51519 on socket: unix:/tmp/php.socket-1 for /index.php?url=campaign/edit/4f6cf84ca8b057ee17000000, closing connection 

Saving data in Mongo goes without issue, it is just file uploads, the file size in question being 45K, so not even a large file.

This is running on AWS EC2, with PHP 5.3.10 and MongoDB 2.0.4

Further Update:

Just to try and make this as concise as possible, and get responses, what I have seemed to determine is that MongoDB is doing something ‘after’ the file is saved in it’s database which is causing the PHP crashing issue.

Once the file has been saved, I can retrieve it without any issue whatsoever, it just seems on initially saving it to the database, it is causing PHP to crash and providing the 500 error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:19:35+00:00Added an answer on June 1, 2026 at 5:19 am

    I recently faced what could be the same problem:

    PHP was segfaulting in a variety of configurations; running PHP in FCGI mode under Lighttpd and under Apache, across x86 and x64 platforms.

    Turns out the culprit was the php-mongo driver (installed from PECL) – versions 1.2.8 and 1.2.9 would cause a segfault. I’m guessing this was after the save to GridFS was completed, as the data appeared to be stored correctly.

    Version 1.2.7 ran just fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Last week I was a debugging a code and a weird situation came up:
This bug tricked me into spending 4 hours debugging perfectly functional code last night.
Debugging some finance-related SQL code found a strange issue with numeric(24,8) mathematics precision. Running
I am debugging a program that fails during a low memory situation and would
I have a situation where I'd like to add a last modified timestamp to
I'm debugging my app with the simulator. And for some moment in concrete situation
While debugging an application i am getting the following error. The CLR has been
Situation: running a Google App Engine site with my static content's default_expiration set to
I'm having problems with debugging DOM changes introduced by some JavaScript code I'm running.
An everyday debugging situation for Java developers is that in which an Exception is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.