Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] $REMOTE_USER not set with Apache2.0.50 and PHP4.3.8
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Kristof
n00b
n00b


Joined: 14 Jul 2004
Posts: 61
Location: Belgium

PostPosted: Sat Aug 07, 2004 3:31 pm    Post subject: [solved] $REMOTE_USER not set with Apache2.0.50 and PHP4.3.8 Reply with quote

Hello,

I just installed Apache 2 and php_mod on my computer. But I still have a little problem I can't get fixed.

I have some php scripts that can only be executed when the user is logged in with .htaccess, so the scripts begin like this:
Code:
if ($REMOTE_USER == "")
    exit;

/*The rest of the php script comes here*/

And these scripts work when I use them on my webspace I get from my school. But when I try to run them on my own webserver, the $REMOTE_USER variable doesn't have a value.

And the directory the script is in is protected with a .htaccess file and I'm pretty sure its correct (because I have to login before I can get to that directory).

The .htaccess file is as follows:
Code:
AuthUserFile /home/kristof/public_html/filemanager/.htpasswd
AuthGroupFile /dev/null
AuthName "Filemanager"
AuthType Basic

require valid-user


Anyone know how I can solve this problem? Might there be something wrong with my php or apache configuration?

Greetings,
Kristof


Last edited by Kristof on Sun Aug 08, 2004 8:38 am; edited 1 time in total
Back to top
View user's profile Send private message
sf_alpha
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2002
Posts: 136
Location: Bangkok, TH

PostPosted: Sat Aug 07, 2004 5:08 pm    Post subject: Reply with quote

using $REMOTE_USER Is deprecated ...
You need to use server environment associative array

$_SERVER["REMOTE_USER"] or something like these (I don't sure)

Or you can use deprecated and security risk 'register_globals' to set variable for environment and form data.[/url]
_________________
Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th
Back to top
View user's profile Send private message
sf_alpha
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2002
Posts: 136
Location: Bangkok, TH

PostPosted: Sat Aug 07, 2004 5:09 pm    Post subject: Reply with quote

using $REMOTE_USER Is deprecated ...
You need to use server environment associative array

$_SERVER["REMOTE_USER"] or something like these (I don't sure)

Or you can use deprecated and security risk 'register_globals' to set variable for environment and form data.
_________________
Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th
Back to top
View user's profile Send private message
Kristof
n00b
n00b


Joined: 14 Jul 2004
Posts: 61
Location: Belgium

PostPosted: Sun Aug 08, 2004 8:38 am    Post subject: Reply with quote

Thanks alot, this fixed my problem...

Greetings,
Kristof
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum