File IO functions
fopen()
$fname = "guestBk.db";
$bytes = filesize($fname);

$fhand = fopen($fname, "r");
$contents = fread($fhand, $bytes);
fclose($fhand);

print($contents);

file_get_contents() and file() are simpler alternatives for retreiving content from text files. The former requires a relatively recent version of PHP, the latter returns an array of lines from the file.
    fgetcsv() -- this function is similar to fgets(), except that it returns an array, using the specified delimiter, or comma by default. Both will stop reading when they encounter a newline character.
      while(
       $myFieldsArr = fgetcsv($fhand, 1024)
      ){
       list($name,$occ,$city,$state,$zip) = $myFieldsArr;
       print("<tr><td>$name</td><td>$occ</td><td>$city</td> <td>$state</td><td>$zip</td></tr>");
      }
    Of course it's best to check if the file_exists() and is_readable() before performing read operations. Otherwise, you may need to use the @ to ignore read errors, as for example, $f = @fopen("file.txt","r");

    Note how the list() function initializes scalar variables to specified names from the source array ($myFieldsArr). This is a useful technique for making your code more legible.

File system issues
ls -l  will give you the permissions of a file or folder from the Unix command line. Similar tools are available in most sFTP clients under the Remote menu, where you can then modify file attributes for files on the remote server.

From the Unix command line, permissions can be modified using chmod.
It is important to know that for files that you will write into from a WWW-initiated script, you must give your destination file write permission for the appropriate user category. If you are using the same group ID as the web server software, you must give group write permission to the destination file, otherwise, you must give it global write permission. The same permissions are needed to 'append' data to the file as to 'write' to them.
Note that unlike Perl CGI files, the .php scripts do not need to be made executable. (One exception being that if you use the CLI form of PHP, you may want to make a script executable.) WWW-based .php scripts are interpreted by the PHP script engine which is embedded in the web server. It is not therefore necessary to launch a new process for each .cgi program, as in the older CGI model. PHP for Windows comes in two flavors - a CGI executable (php.exe), and several SAPI modules (for exapmle php5isapi.dll). The latter form is new to PHP, and provides significantly improved performance and some new functionality. In general, the issue of execution permissions is largely one of the past now, because CGI is disappearing.