Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2011-10-03 21:19:08

Rabobi
Member
Registered: 2009-03-16
Posts: 21

Error when installing fluxbb 1.4.7

I got the following error trying to install fluxbb 1.4.7 on a windows server using PHP 5.2.6 and MySQL 5.0.45:

Notice: Undefined index: o_gzip in C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php on line 1469

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php:1469) in C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php on line 1473

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php:1469) in C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php on line 1474

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php:1469) in C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php on line 1475

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php:1469) in C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php on line 1476

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php:1469) in C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php on line 1479

Notice: Undefined index: o_board_title in C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14\include\functions.php on line 1486
An error was encountered

Error: Unable to write stopwords cache file to cache directory. Please make sure PHP has write access to the directory 'C:\Inetpub\vhosts\mywebsite.com\httpdocs\fluxbb14/cache/'.

Offline

#2 2011-10-04 00:06:36

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,618
Website

Re: Error when installing fluxbb 1.4.7

Well, the problem really seems to be the write permissions for the cache directory.

I do, however, agree that our error message itself shouldn't cause errors like this.
I have created a ticket.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#3 2011-10-05 19:12:05

Rabobi
Member
Registered: 2009-03-16
Posts: 21

Re: Error when installing fluxbb 1.4.7

I think I have discovered why I got this error. The fluxbb install script is suppose to show you an alert message if the cache folder is not writable, but on a windows ntfs server, the is_writable function does not work correctly. See the post by legolas558 here:
http://php.net/manual/en/function.is-writable.php

It appears that it has something to do with the fact that the is_writable function ignores ACLs on a windows ntfs server.

So using the following function as suggested by legolas558 I get the true "is writable" state of a file/folder:

	//
	// PHP's is_writable does not work with Win32 NTFS
	//
	function is_writable_ACLSafe($path)
	{
		if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
			return is_writable_ACLSafe($path.uniqid(mt_rand()).'.tmp');
		else if (is_dir($path))
			return is_writable_ACLSafe($path.'/'.uniqid(mt_rand()).'.tmp');

		// Check tmp file for read/write capabilities
		$rm = file_exists($path);
		$f = @fopen($path, 'a');

		if ($f===false)
			return false;

		fclose($f);

		if (!$rm)
			unlink($path);

		return true;
	}

Last edited by Rabobi (2011-10-06 08:26:59)

Offline

#4 2011-10-11 20:17:05

Rabobi
Member
Registered: 2009-03-16
Posts: 21

Re: Error when installing fluxbb 1.4.7

So has anybody looked into this matter yet?

Offline

#5 2011-10-11 20:37:32

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,618
Website

Re: Error when installing fluxbb 1.4.7

Would you please create a ticket in the bug tracker to make sure this will be taken care of in the next release?


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#6 2011-10-12 12:10:27

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,618
Website

Re: Error when installing fluxbb 1.4.7

Never mind, I created ticket #509 now. This means we'll take care of it at some point.

Thanks for finding this! smile


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#7 2011-11-29 11:28:39

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,618
Website

Re: Error when installing fluxbb 1.4.7

Hey Rabobi,

can you please try whether this implementation works:

//
// Check whether a file/folder is writable.
//
// This function also works on Windows Server where ACLs seem to be ignored.
//
function forum_is_writable($path)
{
	if (is_dir($path))
	{
		$path = rtrim($path, '/').'/';
		return forum_is_writable($path.uniqid(mt_rand()).'.tmp');
	}
	
	// Check temporary file for read/write capabilities
	$rm = file_exists($path);
	$f = @fopen($path, 'a');
	
	if ($f === false)
		return false;
	
	fclose($f);

	if (!$rm)
		@unlink($path);
	
	return true;
}

Put that function in include/functions.php and replace "is_writable" with "forum_is_writable" in install.php.

I'd be glad about a test.

Last edited by Franz (2011-12-13 08:55:48)


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#8 2011-12-13 08:39:27

Rabobi
Member
Registered: 2009-03-16
Posts: 21

Re: Error when installing fluxbb 1.4.7

Franz wrote:

can you please try whether this implementation works...

Thanks, that worked perfectly.

Offline

#9 2011-12-13 08:54:37

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,618
Website

Re: Error when installing fluxbb 1.4.7

Actually, that one would - in some cases - remove files when checking whether the directory exists.

This is fixed now, I also updated the post with the code - and we will release the new version probably this week.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#10 2011-12-13 09:24:30

daris
Developer
From: Poland
Registered: 2008-05-09
Posts: 557

Re: Error when installing fluxbb 1.4.7

Franz wrote:

Actually, that one would - in some cases - remove files when checking whether the directory exists

You're wrong smile this code doesn't remove files that already exist, you missed a

if (!$rm)

line when commiting to the fluxbb repo smile

Offline

#11 2011-12-13 09:35:42

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,618
Website

Re: Error when installing fluxbb 1.4.7

Franz wrote:

This is fixed now, I also updated the post with the code - and ...

tongue


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

Board footer

Powered by FluxBB