AbVog AbVog - 3 months ago 8
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
    and
    post_max_size
    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
Upload
,
UploadField
and
File
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 (
    web1
    ) created by ISPConfig

  • Apache runs as user
    apache:apache

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

  • the upload folder (
    assets
    ) is owned by
    web1:client1
    and has permissions 775

  • the temporary upload folder (
    upload_tmp_dir
    ) is owned by
    web1:client1
    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
SSLRenegBufferSize
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
LogLevel
directive to
trace
but I still had no message about this error in the server logs.

Answer

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.

Comments