Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: phpBB: Unable to add attachments to posts with PHP 8 or higher.

  1. #1
    wmttest is offline Utente Blog
    Join Date
    Mar 2026
    Posts
    7

    Default phpBB: Unable to add attachments to posts with PHP 8 or higher.

    Hi there,

    I've found I'm unable to add attachments to posts with PHP 8 or higher on Altervista, even though this issue doesn't occur on my personal website which uses a paid host.

    If I use PHP 7.3, I get a green tick next to attachments after uploading them, but on PHP 8 or higher I get an exclamation icon and the attachments don't appear in the post after I click submit.

    I can't see anything in phpBB's error log in the ACP, so perhaps someone could look in the logs for an error at roughly 2:57 PM on Fri Mar 20, 2026?

    I did report this some time ago but never got a resolution, however it's more important now that PHP 7.3 is being removed soon.

    Best,
    Hamish

  2. #2
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    792

    Default

    Hello,

    Could you please let me know which version of phpBB you are using? I'll try to reproduce your issue on my side.
    Have you tried updating phpBB to the latest version? (after a full backup).

    Thanks.

    Bye!

  3. #3
    wmttest is offline Utente Blog
    Join Date
    Mar 2026
    Posts
    7

    Default

    Hi there,

    I'm using phpBB 3.3.15 (the latest version at the time of writing). It's also a fresh install, but I've also observed this issue on another forum that was originally installed in 2017 and has been upgraded to the latest version.

    Best,
    Hamish

  4. #4
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    792

    Default

    It seems to be a phpBB bug: https://www.phpbb.com/community/viewtopic.php?t=2589106

    However, the fixes seem to have already been implemented, but the error still occurs (I was able to reproduce it).

    Maybe we should ask on the phpBB forums.

    Bye!

  5. #5
    wmttest is offline Utente Blog
    Join Date
    Mar 2026
    Posts
    7

    Default

    I shall ask and post a reply here with the link.

  6. #6
    wmttest is offline Utente Blog
    Join Date
    Mar 2026
    Posts
    7

    Default

    I don't think this is the same issue actually, as disabling Javascript (I saw this tip on the phpBB forums) shows that "there is not enough free disk space" rather than the other error in that linked post. I shall now report this on the phpBB forums and see what they suggest, and post a link here.

  7. #7
    wmttest is offline Utente Blog
    Join Date
    Mar 2026
    Posts
    7

  8. #8
    wmttest is offline Utente Blog
    Join Date
    Mar 2026
    Posts
    7

    Default

    Looks like it might be this actually: https://tracker.phpbb.com/browse/PHPBB-16705

    Any way to get the php.ini settings changed to make it compatible?

  9. #9
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    792

    Default

    The function disk_free_space() is available on AlterVista, but it returns false.
    Because of this, enabling or checking it via php.ini is not useful, since
    Code:
    function_exists('disk_free_space');
    already returns true.

    If you want to apply a manual workaroud (yes, is not a good way), you can force the check to pass by adding "return true;" at the beginning of the "check_disk_space()":

    phpbb/attachment/upload.php line 303
    Code:
    protected function check_disk_space()
    {
        return true;
        if (function_exists('disk_free_space'))
    ...
    However, in my case this fix was not enough. I also had to initialize "$exitStatus" in the Symfony file:

    /vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php
    On line 57
    Code:
    ob_start();
    $exitStatus = 1;
    passthru('command -v file', $exitStatus);
    $binPath = trim(ob_get_clean());
    Otherwise, a warning like "Undefined variable $exitStatus" may occur (which may break uploads).

    Bye!

  10. #10
    wmttest is offline Utente Blog
    Join Date
    Mar 2026
    Posts
    7

    Default

    I can confirm this behaviour using a PHP script given to me by a member of the phpBB forums. I must insist you fix it so that disk_free_space() works correctly, as this breaks phpBB for all users on PHP 8 or higher on Altervista. Otherwise I will be moving to a different web host.
    Last edited by wmttest; 04-21-2026 at 05:35 PM.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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

SEO by vBSEO