This is a discussion on Sessions within the PHP Language forums, part of the PHP Programming Forums category; PHP 4.3.4 is distributed with SuSE 9.1. Session support is supposed to be default in PHP 4+ ... ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
PHP 4.3.4 is distributed with SuSE 9.1. Session support is supposed to be
default in PHP 4+ ... but In a script I'm writing, my page starts with the lines <?php session_start(); $_SESSION['curKey'] = 0; ?> ...... When the page is loaded, I get the error message "Fatal error: Call to undefined function: session_start() in /srv/www/htdocs/lookups/index.php on line 2" which corresponds to the call to session_start(). session.auto_start = 0 in my php.ini, but an explicit call to session_start() should start the session according to the documentation, so I don't see anything wrong. Anybody have an idea of what I'm missing? tia ---Michael |
|
|||
|
*** Michael Satterwhite wrote/escribió (Sun, 26 Sep 2004 22:18:07 GMT):
> "Fatal error: Call to undefined function: session_start() > in /srv/www/htdocs/lookups/index.php on line 2" Create a PHP file with a call to phpinfo() and check the output. You should have: session Session Support enabled -- -- Álvaro G. Vicario - Burgos, Spain -- Thank you for not e-mailing me your questions -- |
|
|||
|
Alvaro G Vicario wrote:
> *** Michael Satterwhite wrote/escribió (Sun, 26 Sep 2004 22:18:07 GMT): >> "Fatal error: Call to undefined function: session_start() >> in /srv/www/htdocs/lookups/index.php on line 2" > > Create a PHP file with a call to phpinfo() and check the output. You > should have: > > session > Session Support enabled I don't know why I forget about phpinfo(). Regardless, that's the problem. The developers at SuSE apparently don't think we might need that support, so they disabled it. Looks like I get to build my own. |
|
|||
|
What is the name of the php file that your refering to?
> *** Michael Satterwhite wrote/escribió (Sun, 26 Sep 2004 22:18:07 GMT): >> "Fatal error: Call to undefined function: session_start() >> in /srv/www/htdocs/lookups/index.php on line 2" > > Create a PHP file with a call to phpinfo() and check the output. You > should have: > > session > Session Support enabled |
|
|||
|
What is the name of the php file that your refering to?
> *** Michael Satterwhite wrote/escribió (Sun, 26 Sep 2004 22:18:07 GMT): >> "Fatal error: Call to undefined function: session_start() >> in /srv/www/htdocs/lookups/index.php on line 2" > > Create a PHP file with a call to phpinfo() and check the output. You > should have: > > session > Session Support enabled |
|
|||
|
I am using php version 5.0, apache 2.0 and suse 9.1. I tried correct the
error message --> Fatal error: Call to undefined function: session_start() in /mnt/hdb1/home/web/webmail/mailroom.php on line 20--< Using yast to install the rpm file and I even compiled it using the php source code. The docs say that by default session is already enabled in php. The line I am getting the error on is session_start(); I have been working on this for the past 3 days and now I am fustrated with it. The old php version 2 was much easer because when you installed it just worked, now version 5 is a lot harder. Can you please help me? Thanks Phil <?php /* PHPwebmail is a webmail client written in php. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ session_start(); require("not_registered.php"); session_register('passwd','name','version','send_m essage','folder','server',' imap_server','fg_color','link_color','alink_color' ,'bg_color_menu','bg_color_fra me','bg_color_main','sql_host','sql_user','sql_pw' ); // setup user prefs account in DB if ($db_link = mysql_connect($sql_host,$sql_user,$sql_pw)) { @mysql_select_db("phpwebmail"); $sql_query = "SELECT * FROM prefs WHERE user='$name'"; $result = mysql_query($sql_query); // catch SQL errors if (mysql_errno()) echo ("ERROR ".mysql_error()); if (mysql_num_rows($result) == 0) { $sql_query = "INSERT INTO prefs (user, name, email) VALUES('".$n ame."','".$name."','".$name."@".$server."')"; $result = mysql_query($sql_query); // catch SQL errors if (mysql_errno()) echo ("ERROR ".mysql_error()); $main_frame = "<FRAME SRC=\"prefs.php?".SID."&first_time=yes\" M ARGINHEIGHT=8 MARGINWIDTH=8 NAME=\"message_text\">"; } else $main_frame = "<FRAME SRC=\"help.php?".SID."\" MARGINHEIGHT=8 MAR GINWIDTH=8 NAME=\"message_text\">"; } // if db_link ends ?> <HTML><HEAD><TITLE>PHPwebmail Version <? print($version); ?></TITLE> </HEAD> <FRAMESET ROWS="80,100,*" border=1 Frameborder=1> <FRAME SRC="iconbar.php?<?php echo SID; ?>" NAME="iconbar" MARGINHEIGHT=8 MARGINWIDTH=8 SCROLLING=no NORESIZE> <FRAME SRC="mail_index.php?<?php echo SID; ?>" Frameborder=1 MARGINHEIGHT= 8 MARGINWIDTH=8 NAME="message_index"> <?php echo $main_frame; ?> </FRAMESET> </HTML> <noframes> <BODY> PHPwebmail requires frames. Netscape and Internet Explorer both support frames. <BR><BR> <A HREF="http://www.microsoft.com">Microsoft Home Page</A><BR> <A HREF="http://home.netscape.com">Netscape Home Page</A><BR> </BODY> </noframes> linux:/mnt/hdb1/home/web/webmail # |