Page 1 of 1

Fatal error

PostPosted: 27. April 2004 02:29
by jac
I get this err
Fatal error: Call to undefined function: file_get_contents() in /var/www/html/xampp/index.php on line 2

PostPosted: 28. April 2004 11:27
by Stefan
php version < 4.3?

* http://php.net/file_get_contents

if function not exists use

Code: Select all
if (!function_exists('file_get_contents'))
{
    function file_get_contents($filename, $use_include_path = 0)
    {
        $file = @fopen($filename, 'rb', $use_include_path);
        if ($file)
        {
            if ($fsize = @filesize($filename))
            {
                $data = fread($file, $fsize);
            }
            else
            {
                while (!feof($file))
                {
                    $data .= fread($file, 1024);
                }
            }
            fclose($file);
        }
        return $data;
    }
}


$filename need the path to the file you will read.

PostPosted: 28. April 2004 12:00
by jac
now there errs


Warning: fopen("lang.tmp", "w") - Permission denied in /var/www/html/xampp/lang.php on line 2

Warning: fwrite(): supplied argument is not a valid File-Handle resource in /var/www/html/xampp/lang.php on line 3

Warning: fclose(): supplied argument is not a valid File-Handle resource in /var/www/html/xampp/lang.php on line 4

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/xampp/lang.php:2) in /var/www/html/xampp/lang.php on line 5

PostPosted: 28. April 2004 12:45
by Stefan
Warning: fopen("lang.tmp", "w") - Permission denied in /var/www/html/xampp/lang.php on line 2

Wrong filerights
change it with console
Code: Select all
chmod 777 /var/www/html/xampp/lang.tmp


or per directorybrowser -> find file -> rightclick -> filerights(?) sorry i have the german version of the Desktop.

PostPosted: 28. April 2004 21:17
by jac
I dont have a file called lang.tmp

PostPosted: 29. April 2004 06:11
by Kristian Marcroft
Hi,

whats XAMPP doing in /var/www/html ???
Should be in /opt/lampp....

the lang.tmp is created by the Splash.php and contains either de, en or fr...

I'm not to sure about the fr but de and en I am...
try creating a lang.tmp with just an en as content.

So long
KriS

PostPosted: 29. April 2004 12:12
by jac
I dont know but it was put there

PostPosted: 29. April 2004 12:35
by Stefan
What do you mean?

to extract the downloadfile use
Code: Select all
tar xvfz xampp-linux-1.4.4.tar.gz -C /opt

IMO its mandatory to extract the archive by this way.
All paths in the lampp are straightened to this directory(/opt/lampp/).
Sorry, at first i misunderstand your basic problem. And sorry for my bad syntax.

Read: http://www.apachefriends.org/en/xampp-linux.html

good luck!