Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2006
Posts: 353
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 353
Hi All,

I have uploaded the patch to our forum and now running version 8.0.1 and all seems to be ok but when check things I am getting this error message when I click Permision Check in the admin panel.

Fatal error: Uncaught TypeError: readdir(): Argument #1 ($dir_handle) must be of type resource or null, false given in /home/xxxx/public_html/forum/admin/fileperms.php:154 Stack trace: #0 /home/xxxx/public_html/forum/admin/fileperms.php(154): readdir() #1 {main} thrown in /home/xxxx/public_html/forum/admin/fileperms.php on line 154

This is what is in the file on the site concerened in the error and also have attached information on the server which does not show any SQL error logs:

EDIT: Stock UBB.threads 8.0 entire /admin/fileperms.php file

Can anyone assist in what I should be looking for to stop this error message please as it appears to be the only error message that I am getting at this present stage.
Attachments
Forum_Details.jpg

Last edited by isaac; 05/13/2026 12:03 PM. Reason: removed php of entire file
Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
That is all entirely stock; we're sure it's an issue with the paths on the system and PHP8 attempting to generate content and spewing an error (the $dir_handle for example isn't even in the code), could you send a copy of your config.inc.php configuration file to my email


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 353
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 353
Hi Gizmo,

I have sent the file requested.

Thank you for the assistance.

Joined: Apr 2004
Posts: 2,032
Likes: 176
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 2,032
Likes: 176
Thank you for the bug report. I've looked into this and found what is causing the issue.

The error is generated from php 8 on UBB.threads 8.0.x when attempting to read files/folders that are unreachable. If you are currently having issues and want to patch your install now, the fix is listed below.

in /admin/fileperms.php around line 150
FIND:
Code
foreach ($dirs as $k => $v) {
	$results[$v]['header'] = "<span style='color:green;'>OK</span>";
	$results[$v]['checks'] = "";
	$dir = @opendir("../$v");
	while ($file = @readdir($dir)) {
		if ($file == "..") {
			continue;
		}
		if (is_writeable("../$v/$file")) {
			$status = "<span style='color:green;'>OK</span>";
		} else {
			$status = "<span style='color:red;'>FAIL</span>";
			$results[$v]['header'] = "<span style='color:red;'>FAIL</span>";
		}
		if ($file == ".") {
			$file = "<b>&lt;DIRECTORY&gt;</b>";
		}
		$results[$v]['checks'] .= "<tr><td>$file</td><td>$status</td></tr>";
	}
}

REPLACE WITH
Code
foreach ($dirs as $k => $v) {
	$results[$v]['header'] = "<span style='color:green;'>OK</span>";
	$results[$v]['checks'] = "";
	$dir = "../$v";
	if ($handle = @opendir($dir)) {
		while (false !== ($file = @readdir($handle))) {
			if ($file == "..") {
				continue;
			}
			if (is_writeable("../$v/$file")) {
				$status = "<span style='color:green;'>OK</span>";
			}
			if ($file == ".") {
				$file = "<b>&lt;DIRECTORY&gt;</b>";
			}
			$results[$v]['checks'] .= "<tr><td>$file</td><td>$status</td></tr>";
		}
		closedir($handle);
	} else {
		$status = "<span style='color:red;'>FAIL</span>";
		$results[$v]['header'] = "<span style='color:red;'>FAIL</span>";
	}
}

You can manually apply this modification to your forums now, or wait until UBB.threads 8.1.0 is released when it will be included.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.1 // wip: UBB.threads 8.1.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 353
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 353
Hi Isaac,

Thank you for the information and I also received the file and uploaded it to the forum and it did fix the issue with the error message.

Since uploading it to the forum I can now run the permission check which I have done and it is showing the following items that failed.

gallery/install/full (FAIL)
File Status

gallery/install/medium (FAIL)
File Status

gallery/install/thumbs (FAIL)
File Status

No error log showing in the admin panel.

Would this mean that the files are missing or do I need to set the permissions or is something wrong in another file?

Joined: Apr 2004
Posts: 2,032
Likes: 176
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 2,032
Likes: 176
The Permissions Check tool (/admin/fileperms.php) checks the files and directory permissions.
If anything is reported, have a look over here https://www.ubbcentral.com/doc_install.php#upload


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.1 // wip: UBB.threads 8.1.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
There should not be a gallery/install folder within UBB.threads, the default folders would be:
gallery/default/full/
gallery/default/medium/
gallery/default/thumbs/

Each should contain an index.html document.

It's a simple permission check, it looks for ANY folders and ALL files in the UBB.threads path, if it's a folder it checks if it's chmodded 777, if theres a file it wants it 666.

Any additional folders in the gallery/ folder should be numerated with the forum number they belong to, "install" wouldn't be an option.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 353
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 353
Originally Posted by isaac
The Permissions Check tool (/admin/fileperms.php) checks the files and directory permissions.
If anything is reported, have a look over here https://www.ubbcentral.com/doc_install.php#upload

Hi Isaac,

Checked the permissions and they all appear to be correct.

Note: that the galley is showing that gallery/default/ is passing but gallery/install is a fail(non of the files are in it) should the install folder have the same files in it or should I delete the install folder to stop the error showing?

All other files pass.
Attachments
Permisions Forum.jpg

Last edited by Outdoorking; 05/13/2026 1:58 AM.
Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
gallery/install should not exist, as mentioned in my previous post; instead it should only be numerated folders which correspond to forum ids, and the "default" folder.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 353
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 353
Hi Gizmo,

Thanks I have deleted the folder install and now all the permissions are OK.

For the record I have only been checking since the 8.0.1 patch as I have never uploaded files myself till now with the latset patch.

The forum seems all good now and thank you for the support it is really appreciate.

I will now post what i think is my last issue shortly.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
1 members (Gizmo), 156 guests, and 110 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)