Hello,
This is my first question to the list, I have included as much
information as I feel will help someone find a solution to my problem.
Server: RedHat Linux 7.0, Kernel 2.2.16-22
PHP Version: 4.1.0
Apache Version: 1.3.12
Class name: class.Htpasswd.php3
Problem
I have just started using classes, downloaded from www.thewebmasters.net
web site. I am working on user authentication and I am getting a
parse error when the page loads. Only since I started using the
class has this parse error occurred, but I am not sure if it the
class that is causing the problem or not. I have included sections that
I feel are relevant from my httpd.conf, php.ini and locations and
contents of my .htpasswd files.
File Locations:
php config script - php.ini - /usr/local/lib/php.ini
password flat file - .htpasswd - /var/www/html/private/.htpasswd
include directory - - /var/www/html/php/includes
include class name - class.Htpasswd.php3
** start php file to validate user *
html
head
titleQuick Validate Using Htpasswd Class/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body
?php
include(class.Htpasswd.php3);
$aHTPasswd = new Htpasswd(/var/www/html/private/.htpassd);
if (!$aHTPasswd-EXISTS)
{
print(authentication errorbr);
}
else
{
// try to debug by printing to the screen
// echo( passes check for aHTPasswd-EXITS);
if ( $aHTPasswd-verifyUser( phpbook, phpbook ) )
{
print( phpbook is a valid userbr );
}
else
{
print( phpbook is not a valid userbr );
}
}
?
/body
/html
** end php file to validate user *
The following is from my http.conf file.
** start section of httpd.conf file *
### Section 1: Global Environment
ServerType standalone
ServerRoot /etc/httpd
Port 80
User apache
Group apache
ServerAdmin andrew@fremont
ServerName 192.168.2.2
DocumentRoot /var/www/html
Directory /
Options FollowSymLinks
AllowOverride None
/Directory
Directory /var/www/html
Options Indexes Includes FollowSymLinks
# Changed 4-5-02 AllowOverride Limit
# Changed 4-2-02 AllowOverride All
#AllowOverride None
AllowOverride Limit
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
/Directory
** end section of httpd.conf file *
My php.ini file listing all directives, include towards the end.
** start php.ini file *
engine = On
short_open_tag = On
asp_tags = Off
precision= 14
y2k_compliance = Off
output_buffering = Off
output_handler =
zlib.output_compression = Off
implicit_flush = Off
allow_call_time_pass_reference = On
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
highlight.string = #CC
highlight.comment = #FF9900
highlight.keyword = #006600
highlight.bg = #FF
highlight.default = #CC
highlight.html= #00
max_execution_time = 30 ; Maximum execution time of each script, in
seconds
memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
error_reporting = E_ALL ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = Off
track_errors = Off
warn_plus_overloading = Off
include_path = .:/php/includes
doc_root =
user_dir =
extension_dir = ./
enable_dl = On
file_uploads = On
upload_max_filesize = 2M
** end php.ini file *
Here is the details from my .htaccess file that I have installed
inside the folder I want protected. The user ahelis has been
added to the ../../private/.htpasswd successfully.
** start .htaccess file *
AuthUserFile ../../private/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
Limit GET
require ahelis
/Limit
** end .htaccess file *
On a side note, if someone can check my .htaccess permissions as
compared to the directives set in my httpd.conf file, I would
appreciate knowing if I have other problems.
I hope the solution is something that I have over looked or miss
configured. Any assistance is appreciated.
Andrew Schoenherr
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php