Results 1 to 5 of 5

Thread: filesize() [function.filesize]: stat failed

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Default filesize() [function.filesize]: stat failed

    I'm wondering what, in the server configuration has changed in recent months (Dathorn's cpanel55 server) which has impacted a long-ago-installed flatfile PHP image gallery script.

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16000 bytes)

    filesize() [function.filesize]: stat failed for...


    The error occurs regardless of imagefile size, upon attempting to upload an image via the script... suggesting to me it's really a PERMISSIONS problem.
    -=-
    Actually, an imagefile is successfully uploaded, but the script doesn't seem to have permission to check its filesize and/or to move rename the newly uploaded imagefile.

    I haven't recently changed folder permissions.
    I haven't checked PHP safe_mode -- perhaps some change (now enforced server wide) is denying scripts access to the filesize() function?

    Must I now (since PHP version 5whatever has been installed and is more strict?) use some local php.ini setting, or some ini_set() command within the script, to preserve the earlier functionality of the script?

  2. #2
    Administrator AndrewT's Avatar
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,639

    Default

    filesize() itself will work. The issue you need to be concerned with first is the fatal memory error. It is exceeding the 32MB limit. Try creating a file named php.ini with the following in it:

    memory_limit = 64MB

    Upload this file to the domain's public_html directory.

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Default

    After placing the suggested php.ini in the domain's public_html directory, not even the index.php for the app would load. Instead, the memory error immediately displays.

    PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16000 bytes)

    Prior to placement of the php.ini (and after removing it again) at least the php app would correctly display thumbs/images for the files already in place... the error didn't trigger until/unless I attempted to upload a new image. ANY image -- I tested with tiny 4Kb gifs.

    Yeah, the app uses GD, which is a memory hog.
    Yeah, the app is calling imagecreatetruecolor(), whereas it might consume fewer resources if just imagecreate() were used instead...

    ...but these points are moot. Nothing internal to the script has changed.
    I haven't messed with any php or other account setting of my hosting account.
    From my perspective, it. just. stopped. working.


    The script's upload function began throwing this error sometime last fall. I just didn't bother reporting it back then.

    Again, I ask: what has changed in the server configuration?

    When did things switch from Apache to LightSpeed ?

    I attempted to research the problem on my own, prior to posting here & worry the problem stems from some Lightspeed configuration detail:

    http://www.litespeedtech.com/support...ead.php?t=4462

    http://www.litespeedtech.com/support...hp/t-4469.html

  4. #4
    Junior Member
    Join Date
    Jan 2011
    Posts
    3

    Default

    phpinfo() indicates the memory limit is the stock 32Mb and max_upload_size is the stock 4Mb

    FWIW, this php gallery app which has worked fine on the dathhorn-hosted domain
    but its file upload function inexplicably stopped working is MG2 ( www.minigal.dk )

    One of the GD commands it utilizes is imagerotate()

    Tonight, after reading
    "the memory required to rotate an image is greater than the memory needed to create an image or crop it"
    http://www.phpbuilder.com/board/show...php?t=10356160

    as a troubleshooting step, I tried applying that transformation to one of the largest existing images in the gallery. As ever (and still with the stock 32Mb max memory php setting) that works fine.

  5. #5
    Administrator AndrewT's Avatar
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,639

    Default

    Nothing has really changed on the servers that would impact this. Those forum threads are also unrelated. LiteSpeed transitions began last March. Please submit a ticket with the complete details concerning your problem (domain, URLs, necessary login information, etc.) so that we can take a closer look. You should not have continued to receive that memory error at 32MB if you increased the limit to 64MB.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •