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

    forgot to mention the versions of the stuff i am using:

    redhat 7.3
    php 4.1.2
    apache 1.3.23

      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.

        Write a Reply...