1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Image upload - Error: readfile() has been disabled for security reasons

Discussion in 'Troubleshooting and Problems' started by Flynny, Oct 9, 2013.

  1. Flynny

    Flynny Member

    I downloaded and installed XF 1.2 yesterday but I can't get any uploaded images to display properly.

    The image uploads via the Flash Uploader and a small preview is shown at the bottom. When I click insert full image I just get the following thumbnail:

    Screen Shot 2013-10-09 at 15.05.51.png

    If I click insert thumbnail I can see a small version of the image, but when I click it, the viewer opens and closes instantly.

    I get the following error when trying to view any uploaded images:

    ErrorException: readfile() has been disabled for security reasons - library/XenForo/FileOutput.php:36
    Generated By: xxx, 11 minutes ago
    Stack Trace
    #0 [internal function]: XenForo_Application::handlePhpError(2, 'readfile() has ...', '/home/*****/publi...', 36, Array)
    #1 /home/*****/public_html/forums/library/XenForo/FileOutput.php(36): readfile('/home/xxx/publi...')
    #2 /home/*****/public_html/forums/library/XenForo/FrontController.php(214): XenForo_FileOutput->output()
    #3 /home/*****/public_html/forums/index.php(13): XenForo_FrontController->run()
    #4 {main}
    Request State
    array(3) {
      ["url"] => string(71) "http://www.xyz.com/forums/attachments/derbydayheroes-jpg.11/"
      ["_GET"] => array(0) {
      ["_POST"] => array(0) {
    Last edited by a moderator: May 10, 2014
  2. Mike

    Mike XenForo Developer Staff Member

    Unfortunately this is a really really bad decision from your host. There's no reason to disable functions like this (especially if you can write files out). You'll need to contact them and ask them to stop disabling functions.

    (Disabling functions in PHP is mostly an exercise in futility...)
  3. Brogan

    Brogan XenForo Moderator Staff Member

    That sounds like a server configuration issue.
    Have you spoken to your host?
  4. Flynny

    Flynny Member

    I have my own unmanaged vps to save heavily on costs, but I'm no expert in server admin.

    I presume I need to relax some settings in CSF. So far, removing all the restrictions from disable_functions hasn't changed anything.
  5. Flynny

    Flynny Member

    Sorted it. I was loading php.ini recursively for all subfolders in my htaccess. This obviously wasn't needed once I had enabled all the php functions.

    Thanks for your help. I've been reading these forums for months and I'm glad to finally take the plunge & purchase Xenforo.

    Keep up the fantastic work.
    Mike likes this.

Share This Page