Loading...
 
Architecture / Installation

Architecture / Installation


I get these errors on my page.

posts: 1

I get the below when trying to install tikiwiki. Any idea how to fix it?



Warning: tempnam() function.tempnam: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/sthrisss:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/sthrisss/public_html/lib/init/initlib.php on line 101

Warning: session_start() function.session-start: Cannot send session cookie - headers already sent by (output started at /home/sthrisss/public_html/lib/init/initlib.php:101) in /home/sthrisss/public_html/tiki-setup_base.php on line 278

Warning: session_start() function.session-start: Cannot send session cache limiter - headers already sent (output started at /home/sthrisss/public_html/lib/init/initlib.php:101) in /home/sthrisss/public_html/tiki-setup_base.php on line 278
header already sent

posts: 1

I comment the line 101 in initlib.php


--

????? ?????? ?????? ??? ?? ???????? :-)


posts: 31 United States

> I get the below when trying to install tikiwiki. Any idea how to fix it?
>
>
>
> Warning: tempnam() function.tempnam: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/sthrisss:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/sthrisss/public_html/lib/init/initlib.php on line 101
>
> Warning: session_start() function.session-start: Cannot send session cookie - headers already sent by (output started at /home/sthrisss/public_html/lib/init/initlib.php:101) in /home/sthrisss/public_html/tiki-setup_base.php on line 278
>
> Warning: session_start() function.session-start: Cannot send session cache limiter - headers already sent (output started at /home/sthrisss/public_html/lib/init/initlib.php:101) in /home/sthrisss/public_html/tiki-setup_base.php on line 278
> header already sent

What version are you trying to install?
dthacker

posts: 5

> What version are you trying to install?
> dthacker

It happens in version 1.9.8.3. It's a bug in file lib/init/initlib.php, in line 101. The function tempdir() for returning system defined temporary directory calls tempnam(false, ). This is obviously wrong, as the firs parameter is not a boolean value, but the directory where the temporary filename will be created. The problem can be patched in a quick and dirty manner by modifying the call on the line 101 to tempnam('/tmp',). Obviously, this is not the proper way to patch the bug, but it illustrates the point.

posts: 5

> > What version are you trying to install?
> > dthacker
>
> It happens in version 1.9.8.3. It's a bug in file lib/init/initlib.php, in line 101. The function tempdir() for returning system defined temporary directory calls tempnam(false, ). This is obviously wrong, as the firs parameter is not a boolean value, but the directory where the temporary filename will be created. The problem can be patched in a quick and dirty manner by modifying the call on the line 101 to tempnam('/tmp',). Obviously, this is not the proper way to patch the bug, but it illustrates the point.

posts: 5

> > What version are you trying to install?
> > dthacker
>
> It happens in version 1.9.8.3. It's a bug in file lib/init/initlib.php, in line 101. The function tempdir() for returning system defined temporary directory calls tempnam(false, \'\'). This is obviously wrong, as the firs parameter is not a boolean value, but the directory where the temporary filename will be created. The problem can be patched in a quick and dirty manner by modifying the call on the line 101 to tempnam(\'/tmp\',\'\'). Obviously, this is not the proper way to patch the bug, but it illustrates the point.


posts: 2

I still get the same errors in version 1.9.9!

I just googled for some help on:

tikiwiki Warning: tempnam() function.tempnam: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s):

I see that the web is strewn with many broken websites showing the same error.
Presumably, these are the multitudes who never got beyond this point in their installation.
I wonder if I will?

I find it hard to believe that a simple bug like this which shows up in most installations is still there?
What gives?

posts: 7
If you can change the hosting site to use PHP 4 instead of PHP 5 this may solve the problem. It worked for me.

posts: 1
Image
Copy to clipboard
function tempdir() { static $tempdir; if (!$tempdir) { $tempfile = tempnam(false,''); $tempdir = dirname($tempfile); @unlink($tempfile); } return $tempdir; }



Well guys, this is true! When we replace this code

Image
Copy to clipboard
tempnam(false,'')

by that

Image
Copy to clipboard
tempnam('/tmp','')

all does work biggrin

v1.9.8.3