Jump to content

PHPExcel


sseeley

Recommended Posts

I hope someone can point me in the right direction.  I am getting the following error message on my server and my Excel file will not create.  It is working fine on my local machine, just not when I upload to my server.

 

Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/mypcguy2:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/mypcguy2/public_html/accounts/PHPExcel/Writer/Excel5/Worksheet.php on line 299

 

Many thanks in advance for any help.

 

Stuart

Link to comment
Share on other sites

I am getting a little further, it would seem this small peice of code is not allowed to write to a temporary directory, can anyone see where the problem might be?

 

function _initialize()
{
	// Open tmp file for storing Worksheet data
	$fileName = tempnam($this->_tmp_dir, 'XLSHEET');
	$fh = fopen($fileName, 'w+');
	if ($fh) {
		// Store filehandle
		$this->_filehandle = $fh;
		$this->_tempFilesCreated[] = $fileName;
	} else {
		// If tmpfile() fails store data in memory
		$this->_using_tmpfile = false;
	}
}

 

This is the error message?

 

Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/mypcguy2:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/mypcguy2/public_html/accounts/PHPExcel/Writer/Excel5/Worksheet.php on line 299

Link to comment
Share on other sites

A) $this->_tmp_dir is either empty or is set to a value that is outside of the open_basedir allowed path(s),

 

B) Have you checked what is in $this->_tmp_dir to see why it might be causing that error,

 

C) You can apparently ignore that warning because the code stores the data in memory if it cannot create a temporary file.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.