MyBB Community Forums

Full Version: URGENTLY NEED HELP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Cannot redeclare scandir() in /home/myforum/public_html/forum/inc/functions_compat.php on line 72


I`m having this problem after installation.

I`m using MyBB 1.4.8

Could anyone help ? URGENT

Will appreciate for your help, thanks
Link?
What version of PHP are you using?
(2009-09-09, 03:43 AM)KuJoe Wrote: [ -> ]What version of PHP are you using?

php 5....any problem with it?

please help , thank you
Yes, but is it 5.3?
yes...is php 5.3

problem still remain >.<"
Current Mybb does not support php 5.3. You will have to downgrade to the last 5.2 version or find a thread around here (don't have the link atm) describing the code changes you need to do to some mybb files to make it work with php 5.3.
Or wait for the next version
PHP 5.3.0 fixes: http://community.mybboard.net/thread-521...#pid372017

I don't think that will fix this problem though, this hasn't come up before and isn't mentioned these changes... it's weird because it says this:

if(!function_exists('scandir'))
{
	function scandir($directory, $sorting_order=0)
	{
	....

It's only trying to declare the function if it doesn't exist to begin with... try this, change line 70 of ./inc/functions_compat.php from:

if(!function_exists('scandir'))

to:

/*if(!function_exists('scandir'))

and line 95 from:

}

to:

}*/

See if that works. Basically just commenting out the code that seems to be causing the problem. If it's saying it can't redeclare it, it must already exist, so I'm not sure why it's going through the function_exists statement to get to line 72 where it redeclares the function, thus causing the error Huh

I don't know if that's a 'good fix', just see if it works... I'll see if a Dev can explain what might be going on.
(2009-09-09, 12:19 AM)kelvin86 Wrote: [ -> ]I`m having this problem after installation.

Can you elaborate? Is it while you're installing? Logging in after installing?...
If Matt's fix works then it's a bug in PHP, not MyBB. You should ask your host to make sure they're running the latest stable version, or if the problem still exists on the latest stable, ask them to downgrade to a version that works until PHP is able to fix the problem.
Pages: 1 2