Click to See Complete Forum and Search --> : browscap.ini can't be read


Anon
08-03-2002, 08:39 PM
Hi,

I am new to php so bear with me...

I want to use the get_browser() function and so i need to indicate in php.ini where the browscap.ini file is. I have a line in my php.ini file that reads like this:

[browscap]
browscap = "/var/www/browscap.ini"

I have verified that this is the correct path to the browscap.ini file.

when i start apache, it fails. I find this error recorded in the error_log file:

PHP Warning: Cannot open '/var/www/browscap.ini' for reading in Unknown on line 0

if i comment out the line in php.ini, or if i rename the browscap.ini file to something else, then apache starts just fine.

I am wondering, do i need some special permissions on the browscap.ini file so that php can open it for reading? Currently it has read/write permissions given to root, and read permissions given to everyone else. i.e., its permissions are, in unix speak, -rw-r--r--

i really need to get this working, so any help is much appreciated!

thanks,
Jesse

Anon
08-03-2002, 08:42 PM
forgot to mention the versions of the stuff i am using:

redhat 7.3
php 4.1.2
apache 1.3.23

ebird
08-04-2002, 02:23 PM
Make sure not only your browscap.ini file is world readable, but also the directory where it is located:

chmod 755 /var/www/.
chmod 644 /var/www/browscap.ini

issued as root should do the trick. At least this is how it works for me.