I'm trying to get PHP authentication (using the headers to request
authentication, and then checking $_SERVER[PHP_AUTH_USER] and
$_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to get
it to work. The login request box pops up fine, but when I enter the correct
details, it just pops back up again, and then again, before finally dumping
me at the authentication failed page. I've tried looking at phpinfo(), and
PHP_AUTH_USER and PHP_AUTH_PASSWD are definitely not being filled. Having
browsed google, I came up with two possible answers:
1. I'm already using basic HTTP authentication via apache, and so (for
security reasons) PHP doesn't get passed the user and password.
This isn't the case - authentication is definitely switched off, and
AuthType doesn't occur anywhere in my apache config. I've tried switching
authentication on, and this means that the REMOTE_USER field gets filled, as
expected, but has no effect on PHP_AUTH_USER (also as expected).
2. I'm using the CGI version of PHP, rather than the Apache module.
I don't think this is the case, but phpinfo() reports the PHP server API as
"Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm using
the module or not?
For reference, I'm running:
Mandrake 9.1
Apache 2.0.47
PHP 4.3.1
Any suggestions would be gratefully appreciated - if you'd like the full
output of my phpinfo(), or the exact script I'm using (although I've tried a
number of PHP authentication test scripts without any difference in
results), then let me know. Finally, if it turns out I'm not using a PHP
module, how can I set apache up so that it does? (I've tried adding
LoadModule lines to my http2.conf, which doesn't make any difference).
Thanks. 2 6777
On Wed, 24 Sep 2003 23:23:55 +0100, "Andrew Brett" <us****@brettwe b.plus.com>
wrote: I'm trying to get PHP authentication (using the headers to request authentication , and then checking $_SERVER[PHP_AUTH_USER] and $_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to get it to work. The login request box pops up fine, but when I enter the correct details, it just pops back up again, and then again, before finally dumping me at the authentication failed page. I've tried looking at phpinfo(), and PHP_AUTH_USE R and PHP_AUTH_PASSWD are definitely not being filled. Having browsed google, I came up with two possible answers:
1. I'm already using basic HTTP authentication via apache, and so (for security reasons) PHP doesn't get passed the user and password. This isn't the case - authentication is definitely switched off, and AuthType doesn't occur anywhere in my apache config. I've tried switching authenticati on on, and this means that the REMOTE_USER field gets filled, as expected, but has no effect on PHP_AUTH_USER (also as expected).
2. I'm using the CGI version of PHP, rather than the Apache module. I don't think this is the case, but phpinfo() reports the PHP server API as "Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm using the module or not?
You are using the module.
For reference, I'm running:
Mandrake 9.1 Apache 2.0.47 PHP 4.3.1
Any suggestions would be gratefully appreciated - if you'd like the full output of my phpinfo(), or the exact script I'm using (although I've tried a number of PHP authentication test scripts without any difference in results), then let me know. Finally, if it turns out I'm not using a PHP module, how can I set apache up so that it does? (I've tried adding LoadModule lines to my http2.conf, which doesn't make any difference).
This appears relevant:
http://bugs.php.net/bug.php?id=2044 1
Are you in safe mode?
--
Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk )
Space: disk usage analysis tool (http://www.andyhsoftwa re.co.uk/space)
Thanks for the suggestion. However, this report only covers cases where
basic HTTP authentication (using .htaccess) is switched on. I've made sure
it's switched off, but that makes no difference.
"Andy Hassall" <an**@andyh.co. uk> wrote in message
news:57******** *************** *********@4ax.c om... On Wed, 24 Sep 2003 23:23:55 +0100, "Andrew Brett"
<us****@brettwe b.plus.com> wrote:
I'm trying to get PHP authentication (using the headers to request authentication , and then checking $_SERVER[PHP_AUTH_USER] and $_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to
getit to work. The login request box pops up fine, but when I enter the
correctdetails, it just pops back up again, and then again, before finally
dumpingme at the authentication failed page. I've tried looking at phpinfo(),
andPHP_AUTH_USE R and PHP_AUTH_PASSWD are definitely not being filled. Having browsed google, I came up with two possible answers:
1. I'm already using basic HTTP authentication via apache, and so (for security reasons) PHP doesn't get passed the user and password. This isn't the case - authentication is definitely switched off, and AuthType doesn't occur anywhere in my apache config. I've tried switching authenticati on on, and this means that the REMOTE_USER field gets filled,
asexpected, but has no effect on PHP_AUTH_USER (also as expected).
2. I'm using the CGI version of PHP, rather than the Apache module. I don't think this is the case, but phpinfo() reports the PHP server API
as"Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm
usingthe module or not?
You are using the module.
For reference, I'm running:
Mandrake 9.1 Apache 2.0.47 PHP 4.3.1
Any suggestions would be gratefully appreciated - if you'd like the full output of my phpinfo(), or the exact script I'm using (although I've
tried anumber of PHP authentication test scripts without any difference in results), then let me know. Finally, if it turns out I'm not using a PHP module, how can I set apache up so that it does? (I've tried adding LoadModule lines to my http2.conf, which doesn't make any difference).
This appears relevant:
http://bugs.php.net/bug.php?id=2044 1
Are you in safe mode?
-- Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk ) Space: disk usage analysis tool (http://www.andyhsoftwa re.co.uk/space) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Timo Steinbach |
last post by:
Hi,
I use basic authentication in Apache. I like to use the global variable
$_SERVER. Unfortunately this variable is empty/no
availabe. Same with PHP_AUTH_PW. AUTH_TYPE is working and states
"Basic". Can somebody help me with this?
Thanks
Timo
|
by: Muffinman |
last post by:
Hi,
I got a web site which kinda relies on the $_SERVER
var. Now I got a free account at Lycos and apparently they do not have
Apache or do not have it running as a module since this var is empty.
All I want is to be able to see which user has logged in through the
..htaccess dialog. Is there any other way to find this out, even on other
web servers?
Thanks in advance, Maarten
|
by: BT3 |
last post by:
(newbie)
I have taken some code directly out of a book:
<?php
// if we are using IIS, we need to set $PHP_AUTH_USER and $PHP_AUTH_PW
if (substr($SERVER_SOFTWARE, 0, 9) == 'Microsoft' &&
!isset($PHP_AUTH_USER) &&
!isset($PHP_AUTH_PW) &&
substr($HTTP_AUTHORIZATION, 0, 6) == 'Basic '
|
by: jerrygarciuh |
last post by:
Hello,
I am finding that on a new server where I am developing
$_SERVER and
$_SERVER
Do not show up in $_SERVER when I when they should be defined I test
using
print_r($_SERVER) or this
|
by: Grant Collins |
last post by:
Hi
I am writing a web based application as part of a small project that I
am undertaking using servlets beans and jsp.
I already have one servlet - bean - jsp page working and I have
written another servlet - bean - jsp but I am hitting an error from
tomcat that I have no idea why it is failing. I am getting an
org.apache.jasper.JasperException: with the root cause being
java.lang.ClassNotFoundException:
| |
by: Bernard Higonnet |
last post by:
I'm running Apache/2.0.52 (Unix) mod_perl/1.99_16 Perl/v5.8.5 PHP/5.0.1
under FreeBSD 4.11-RELEASE #0.
I suddenly (sic) no longer have PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE or
REMOTE_USER or any such variables. They do not show up in phpinfo() nor do
they work as expected programmatically.
I used to have them a few weeks ago.
I have not changed any of versionned packages shown above in months.
|
by: rbragg |
last post by:
In my db, I have the fields user and pass with one record.
With the following code, I get a continuous dialog box display. If I put in a bogus user/pass OR the correct user or pass, the dialog box pops up again.
<?php
//assume user is not authenticated
$auth = false;
$user = $_SERVER;
|
by: gsherp |
last post by:
How do I unset PHP_AUTH_USER and PHP_AUTH_PW?
I am trying to create a logout script and I am encountering a problem where when go to relogin, I am already logged in.
In my logout script, I started a session, unset(session), and then destroy_session(). But, everytime I go back to the login link, It does not give me the window popup for the login information.
Only when I close the brower and then try logging in does the popup window...
|
by: yawnmoth |
last post by:
I was trying to test the following PHP script and am having some
difficulty:
<?php
if (empty($_SERVER) ||
empty($_SERVER))
{
header('WWW-Authenticate: Basic realm="Admin Control Panel"');
header('HTTP/1.0 401 Unauthorized');
exit;
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |