AbVog AbVog - 1 year ago 133
Apache Configuration Question

How to diagnose file upload failures in SilverStripe running on Apache

I am facing a pretty common situation judging from the questions either here on SO or in the SilverStripe forums: file uploads fail.

However, my situation seems to stem from an issue that I haven't met yet on the Web; from reading other questions and many blog articles or forum threads, I have ruled out:

  • Permission problems

  • upload_max_filesize
    in the PHP configuration (both set to 8M)

  • LimitRequestBody
    in the Apache Configuration (default value of 0, meaning "unlimited")

I have ruled these out for many reasons but this picture shows with an example of three consecutive uploads that the uploads are sometimes working:

Screenshot of the file upload page in SilverStripe

I have also started a thread on the SilverStripe forums for this problem, but I have little hope of having luck solving the problem there.

I have set up breakpoints in the
classes, and stepped through the code for hours without succeeding in identifying the cause of the error.

My finding so far is that any file above 128 kiB causes an internal server error. Any file below this size threshold gets uploaded as expected.

All logs (Apache, PHP, SilverStripe) are totally mute when this error occurs.

A permission issue seems very unlikely because:

  • PHP runs in Fast-CGI mode as a user (
    ) created by ISPConfig

  • Apache runs as user

  • I have added
    to the group of user so that
    groups web1
    gives me
    web1 : client1 sshusers
    groups apache
    gives me
    apache : apache ispapps ispconfig client1

  • the upload folder (
    ) is owned by
    and has permissions 775

  • the temporary upload folder (
    ) is owned by
    and permissions are 775.

I believe what I'm looking is a means of somehow getting information about where and why the uploads fail. Is it possible to set the loglevel of Apache to "debug" or "trace"?

NOTE: an entry in the "Similar Questions" led me to this answer, which hints at
being by default at exactly 128 kiB. Unfortunately, whether the protocol is HTTPS or HTTP has no influence: the problem shows up.

[EDIT] I had later on set the
directive to
but I still had no message about this error in the server logs.

Answer Source

Quick googling took me to the following articles:

Those suggest to check FcgidMaxRequestLen setting value.

This doesn't answer how to debug that correctly but helps solve the original issue.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download