$_SESSION not working, and PHP not displaying errors.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

$_SESSION not working, and PHP not displaying errors.

Post by php_wiz_kid »

On my local Windows machine I can't get the global $_SESSION variable to work. I can run my script on my local machine and not get it to work, and then upload to my server and it works just fine. The server is running under Linux. Also PHP doesn't display errors, when I have an error it just displays a blank page, and I have to blindly go through my code and fix the errors wich is a pain in the butt. Thanks.
User avatar
Zeceer
Forum Contributor
Posts: 136
Joined: Fri Aug 02, 2002 5:10 am
Location: Norway

Post by Zeceer »

Try using: $HTTP_SESSION_VARS['variable']. Are you sure you have installed PHP right, and all settings with session is OK?
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

That's what I think the problem is. What should I mess with to see if I do have the right settings? Do you have any idea on the PHP errors?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

there are some parameters that control php's error logging.
these are the settings as found in php.ini-recommend
error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
track_errors = Off
and some more.
So by default all errors are reported to the webserver's error.log.
For Apache this is the file <apache install dir>/logs/error.log

All those parameters are explained by the comments in php.ini-recommended.

while having your php.ini open you can check the section

Code: Select all

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this 
; variable in order to use PHP's session functions.
session.save_path = /tmp
if you haven't changed this setting yet do so now
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

Where should I point the session folder? Sorry if this is a stupid question.
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

Everything is now officially working. Thanks a million Volka. You are my savior!
Post Reply