Re: Session_start not working



Flamer wrote:
tony kidd wrote:


Hi All

I've got a probelm! I keep getting this message:

Fatal error: Call to undefined function: session_start() in
/srv/www/htdocs/page1.php on line 4

It seems to me that the solution is the following:

As the previous note said, the session_start() function needs a
directory to write to.

You can get Apache plus PHP running in a normal user account. Apache
will then of course have to listen to an other port than 80 (for
instance, 8080).

Be sure to do the following things:
- create a temporary directory PREFIX/tmp
- put php.ini in PREFIX/lib
- edit php.ini and set session.save_path to the directory you just created

Otherwise, your scripts will seem to 'hang' on session_start().
...

The above came from php.net at http://au.php.net/session_start.

The problem is that I don't understand the answer. Can someone please
tell me where the PREFIX/tmp folder is (or should be)? I'm running PHP
from /svr/www rather than from a user directory (incase that makes any
difference).

Sorry if it's a dumb question but I'm new to this!


Hello, what you want do to is, create a php file with <?php phpinfo();
?> and run that in a webbrowser, it outputs your configuration
settings, have a look at the variable session_save_path normally its
tmp\ or something, make sure that directory has read/write access, if
there is no value in the configuration edit your php.ini and find the
session_save_path and enter tmp/ as the value, make sure the folder
exists c:\tmp and that there is write access on it.

Flamer.


Thanx for your help Flamer, I'm still confused tho.

Let me explain a bit more. I'm trying to get phplens working on suse 10.1. I have php and mysql installed and they are both working. I can use phpmyadmin no probs. However when I try to run the phplens installer I get the following:

Fatal error: Call to undefined function: session_start() in /srv/www/htdocs/phplens/installer/index.php on line 14

With your help I looked at phpinfo but couldn't find session.save_path. I looked in the php.ini file and found it. It's set to session.save_path = /var/lib/php.

OK so I created a tmp directry in /var/lib/php. I then put a copy of php.ini in this folder (not that I think that will make any difference but hey, you never know!). Then I opened up the permissions so that all and sundry can access this directory.

I tried it again and got the same error.

What have I done wrong?

tony
.



Relevant Pages

  • [Full-Disclosure] [waraxe-2005-SA#040] - Full path disclosure and XSS in PhpNuke 6.x-7.6
    ... Fatal error: Cannot instantiate non-existent class: ... Fatal error: Call to undefined function: opentable ... SiteMapper - free php script for phpNuke powered ... Do you Yahoo!? ...
    (Full-Disclosure)
  • Fatal Error: Win2003 & mysql_connect function [PLEASE HELP]
    ... I am running Win2k3 Server and when I try to use the mysql_connect ... Fatal error: Call to undefined function mysql_connectin ... same as my XP machine) and I know that mysql works fine with PHP as I ...
    (comp.lang.php)
  • Help with createimagefromjpeg not working
    ... but am getting a fatal error message as follows ... Fatal error: Call to undefined function: imagecreatefromjpegin ... according to the php manual it has been available since ver 3 of php. ... Note that php is installed on my webhosts server and not my local PC. ...
    (comp.lang.php)
  • Help
    ... and from php I can't connect to Postgresql I have this error ... Fatal error: call to undefined function pg_connect ... But my script phpinfo(); show me ...
    (freebsd-questions)
  • php zip code will NOT work on my WinXP Pro IIS installtion!!
    ... but php terminology for getting and installing ... Fatal error: Cannot instantiate non-existent class: ziparchive in C... ... Is this extract feature only available to php 5 users? ... containing various files, into another folder. ...
    (comp.lang.php)