> I came across some errors regarding undefined variables in my > sumbmission form to login to a restricted area (members only)... > This tutorial I'm working on to get a better understanding of php > tells me to start off by using session_start(); and then register the > variables i want to use within the script. > This was using 1.3.33 Apache and 4.3.10 php. > > The people I bought this tutorial off said to use IIS instead. So I > uninstalled everything and installed IIS.. that was just another > headache altogether, nothing worked. I've spent probably the best > part of the whole day (11hrs) trying to work out why IIS wasn't > working or why the previous set up of Apache & Php were throwing out > the errors i was facing. > > Now I have a whole new set of weird error notices after installing a > different version of Apache and PHP (Apache 2.0.47 & php 4.3.3) > =========== > Warning: session_start(): > open(/tmp\sess_54d21fe98c5dad4ff7a80889fcecfabf, O_RDWR) failed: No > such file or directory (2) in > C:\Apache2\Apache2\htdocs\examples\login.php on line 1 > > Warning: session_start(): Cannot send session cookie - headers already > sent by (output started at > C:\Apache2\Apache2\htdocs\examples\login.php:1) in > C:\Apache2\Apache2\htdocs\examples\login.php on line 1 > > Warning: session_start(): Cannot send session cache limiter - headers > already sent (output started at > C:\Apache2\Apache2\htdocs\examples\login.php:1) in > C:\Apache2\Apache2\htdocs\examples\login.php on line 1 > > > > Warning: Unknown(): open(/tmp\sess_54d21fe98c5dad4ff7a80889fcecfabf, > O_RDWR) failed: No such file or directory (2) in Unknown on line 0 > > Warning: Unknown(): Failed to write session data (files). Please > verify that the current setting of session.save_path is correct (/tmp) > in Unknown on line 0 > ================================================== > > For the life of me I don't understand these errors and can't even > find a fix at php.net or alike. I even copied the entire pre-made > file from the tutorial CD just incase I made some kind of typo, but I > hadn't and still got the above errors... > > Can any one help why I'm being given these notices above? > > Many thanks in advance... > > Litchcockbell. :Oo
Technically, these are not errors; they are warnings. Some versions of PHP are configured to display warnings and others are not. This can be adjusted in the /etc/php.ini file (on a Unix or Linux system). However, based on your attempts to install IIS, I have to assume that you are using Windows. You mention a paid tutorial which recommended use of session_start() and session_register(). This latter function only works when register_globals (a value in php.ini) is set to "on". This was set to "off" on newer installations to improve security of PHP programs. I would guess that the tutorial contains old information. Working with session variables involves making changes to HTTP headers and they have to be handled correctly and carefully in PHP. The session variables are stored on the server in a temporary directory (/tmp on a Unix or Linux system) and the particular directory is determined by a value set in the php.ini config file. Your error message: > Warning: Unknown(): open(/tmp\sess_54d21fe98c5dad4ff7a80889fcecfabf, > O_RDWR) failed: No such file or directory (2) in Unknown on line 0 looks as if the PHP installation is configured to work for Unix but the backslash is reminiscent of Windows. You will have to look up a tutorial on configuring PHP for Windows to determine a working directory for storing session files. I mentioned that programming PHP with sessions has to be done carefully. The warnings: > Warning: session_start(): Cannot send session cookie - headers already > sent by (output started at > C:\Apache2\Apache2\htdocs\examples\login.php:1) in > C:\Apache2\Apache2\htdocs\examples\login.php on line 1 > > Warning: session_start(): Cannot send session cache limiter - headers > already sent (output started at > C:\Apache2\Apache2\htdocs\examples\login.php:1) in > C:\Apache2\Apache2\htdocs\examples\login.php on line 1 indicate that you have a print or echo statement on line 1 of your login.php file or that the opening <?php tag is not on the first line, first character position. James _____ James D. Keeline http://www.Keeline.com http://www.Keeline.com/articles http://Stratemeyer.org http://www.Keeline.com/TSCollection http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc. Spring Semester Begins Jan 31 -- New Classes Start Every Few Weeks. Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
