[GH-ISSUE #873] Fatal error: Call to undefined function disk_total_space() #583

Closed
opened 2026-03-02 16:00:00 +03:00 by kerem · 7 comments
Owner

Originally created by @timint on GitHub (Oct 20, 2022).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/873

Fatal error: Uncaught Error: Call to undefined function disk_total_space() in tinyfilemanager.php:2146

Using latest master build

Originally created by @timint on GitHub (Oct 20, 2022). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/873 Fatal error: Uncaught Error: Call to undefined function disk_total_space() in tinyfilemanager.php:2146 Using latest master build
kerem closed this issue 2026-03-02 16:00:00 +03:00
Author
Owner

@ririko5834 commented on GitHub (Oct 23, 2022):

I have the same issue.
Using php v8.0

<!-- gh-comment-id:1288052941 --> @ririko5834 commented on GitHub (Oct 23, 2022): I have the same issue. Using php v8.0
Author
Owner

@timint commented on GitHub (Oct 23, 2022):

This is a function in PHP that appears to be missing on some web hosts. Checking
if the function exists before use should solve the problem.

https://www.php.net/manual/en/function.disk-total-space.php

<!-- gh-comment-id:1288113485 --> @timint commented on GitHub (Oct 23, 2022): This is a function in PHP that appears to be missing on some web hosts. Checking if the function exists before use should solve the problem. https://www.php.net/manual/en/function.disk-total-space.php
Author
Owner

@smalos commented on GitHub (Oct 24, 2022):

This
fm_get_filesize(@disk_total_space($path))

could be replaced with:

function_exists('disk_total_space') ? fm_get_filesize(@disk_total_space($path)) : 'n/a'

<!-- gh-comment-id:1289003557 --> @smalos commented on GitHub (Oct 24, 2022): This `fm_get_filesize(@disk_total_space($path))` could be replaced with: `function_exists('disk_total_space') ? fm_get_filesize(@disk_total_space($path)) : 'n/a'`
Author
Owner

@ririko5834 commented on GitHub (Oct 24, 2022):

It should be fixed

<!-- gh-comment-id:1289185583 --> @ririko5834 commented on GitHub (Oct 24, 2022): It should be fixed
Author
Owner

@smalos commented on GitHub (Oct 24, 2022):

It should be fixed

How did you fix it?

<!-- gh-comment-id:1289422640 --> @smalos commented on GitHub (Oct 24, 2022): > It should be fixed How did you fix it?
Author
Owner

@ririko5834 commented on GitHub (Oct 25, 2022):

I didn't, but I want to say that some contributor should fix it, make PR.

<!-- gh-comment-id:1290632639 --> @ririko5834 commented on GitHub (Oct 25, 2022): I didn't, but I want to say that some contributor should fix it, make PR.
Author
Owner

@timint commented on GitHub (Oct 25, 2022):

This is the line to edit:

<?php echo lng('PartitionSize').': <span class="badge badge-light">'.fm_get_filesize(@disk_free_space($path)) .'</span> '.lng('FreeOf').' <span class="badge badge-light">'.fm_get_filesize(@disk_total_space($path)).'</span>'; ?>
github.com/prasathmani/tinyfilemanager@805308a013/tinyfilemanager.php (L2152)

Replace it with something like this:

                            <?php if (function_exists('disk_free_space') && function_exists('disk_total_space')) { ?>
                            <?php echo lng('PartitionSize').': <span class="badge badge-light">'.fm_get_filesize(@disk_free_space($path)) .'</span> '.lng('FreeOf').' <span class="badge badge-light">'.fm_get_filesize(@disk_total_space($path)).'</span>'; ?>
                            <?php } ?>

I don't have a cloned repo to commit this.

<!-- gh-comment-id:1290697211 --> @timint commented on GitHub (Oct 25, 2022): This is the line to edit: ` <?php echo lng('PartitionSize').': <span class="badge badge-light">'.fm_get_filesize(@disk_free_space($path)) .'</span> '.lng('FreeOf').' <span class="badge badge-light">'.fm_get_filesize(@disk_total_space($path)).'</span>'; ?> ` https://github.com/prasathmani/tinyfilemanager/blob/805308a01318b22b08218243e0cd81a0432de522/tinyfilemanager.php#L2152 Replace it with something like this: ``` <?php if (function_exists('disk_free_space') && function_exists('disk_total_space')) { ?> <?php echo lng('PartitionSize').': <span class="badge badge-light">'.fm_get_filesize(@disk_free_space($path)) .'</span> '.lng('FreeOf').' <span class="badge badge-light">'.fm_get_filesize(@disk_total_space($path)).'</span>'; ?> <?php } ?> ``` I don't have a cloned repo to commit this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#583
No description provided.