Pandee Posted February 3, 2021 Share Posted February 3, 2021 Hello I have the following environment: - Apache 2 -Ubuntu 18.04 -MySQL My problem is the $_SERVER['REMOTE_USER'] - When I check the phpinfo.php it shows up as empty or "No value". However I did set it on a page like so: $_SERVER["REMOTE_USER"] = $_SESSION["username"]; During the login event and it is working when printing: print "REMOTE_USER: ".$_SERVER["REMOTE_USER"]."\n"; Am I setting it incorrectly or perhaps theres a proper way to do it? Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/312092-_serverremote_user-is-empty-during-phpinfophp/ Share on other sites More sharing options...
requinix Posted February 3, 2021 Share Posted February 3, 2021 That is not what REMOTE_USER is for. Why do you think you are supposed to be using it? Quote Link to comment https://forums.phpfreaks.com/topic/312092-_serverremote_user-is-empty-during-phpinfophp/#findComment-1584213 Share on other sites More sharing options...
Pandee Posted February 4, 2021 Author Share Posted February 4, 2021 (edited) Hello! You see Im trying to link a wiki installation to use an existing database with users already populated. Ive been trying my best to research on getting it work and apparently it needs remote_user to parse a remote login into the wiki. In doing so a user wont need to login twice. Examples of this is like: https://www.mediawiki.org/wiki/Extension:Auth_remoteuser Or for doku this: https://www.dokuwiki.org/plugin:authremoteuser Thanks @requinixfor the help Edited February 4, 2021 by Pandee Quote Link to comment https://forums.phpfreaks.com/topic/312092-_serverremote_user-is-empty-during-phpinfophp/#findComment-1584223 Share on other sites More sharing options...
requinix Posted February 4, 2021 Share Posted February 4, 2021 The REMOTE_USER is a value that is populated for you if the user is set up to be authenticated through your web server. It is not. Nor is it likely what you should be using if you have to work with a database. You need a custom (potentially) mechanism to authenticate users against your database. That seems to mean using AuthManager. Quote Link to comment https://forums.phpfreaks.com/topic/312092-_serverremote_user-is-empty-during-phpinfophp/#findComment-1584224 Share on other sites More sharing options...
Pandee Posted February 4, 2021 Author Share Posted February 4, 2021 Ok! Thanks for that link. Ill do my best to study it up Quote Link to comment https://forums.phpfreaks.com/topic/312092-_serverremote_user-is-empty-during-phpinfophp/#findComment-1584225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.