|
|
#1 |
|
Prospect
Join Date: Jan 2002
Location: Hong Kong
Posts: 24
|
PHP permission problems
I'm new to PHP but I've been trying to set up page to display the currently playing track in QT Streaming Server.
I've got everything working nicely except that the PHP gives me permission errors when it tries to access the file in the quicktime streaming directory. If I copy the playlist.current file to the webserver/documents/ folder where the php file is located it works fine. The code and errors are below - I think it might be to do with PHP permissions to access folders but I'm not sure - can anyone help? <?php // Define path to playlist.current $path = "/library/quicktimestreaming/playlists/eclectasy/eclectasy.current"; // Read playlist.current into $file $file = fopen($path, "r"); // Read the contents of $file into $content $content = fread ($file, filesize($path)); // Separate into parts and put in $info array $info = explode("/",$content); // Delete .mp3 $song = substr($info[5], 0, -4); // Make sure to close after you open fclose($file); // Print the information echo "<br> Track: $song <br>"; echo "<br> Album: $info[4] <br>"; echo "<br> Artist: $info[3] <br>"; ?> And the output I get: Warning: fopen("/library/quicktimestreaming/playlists/eclectasy/eclectasy.current", "r") - Permission denied in /Library/WebServer/Documents/trackinfo.php on line 7 Warning: stat failed for /library/quicktimestreaming/playlists/eclectasy/eclectasy.current (errno=13 - Permission denied) in /Library/WebServer/Documents/trackinfo.php on line 10 Warning: Supplied argument is not a valid File-Handle resource in /Library/WebServer/Documents/trackinfo.php on line 10 Warning: Supplied argument is not a valid File-Handle resource in /Library/WebServer/Documents/trackinfo.php on line 19 Track: Album: Artist: |
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: Jul 2002
Location: Louisiana
Posts: 208
|
What are the permissions on the folder your "eclectasy.current" is in? (and the folders up from that.)
|
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jan 2002
Location: Hong Kong
Posts: 24
|
nosaj - you are the man!!!
I did chmod 777 on the directory, not just the file and it worked!!! Probably a simple error but I'm a newbie to all this! Cheers Der
|
|
|
|
|
|
#4 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
we need to see owner/group and permissions of the directories in the path to the
playlist show us the appropriate output, like so... Code:
$ find /Library/QuickTime -type d -print0 | xargs -0 ls -ld drwxrwxr-x 10 root admin 340 Nov 5 05:50 /Library/QuickTime drwxrwxr-x 4 merv admin 136 Oct 2 11:13 /Library/QuickTime/Toast Video CD Support.qtx.diasbled drwxrwxr-x 4 merv admin 136 Oct 2 11:13 /Library/QuickTime/Toast Video CD Support.qtx.diasbled/Contents drwxrwxr-x 4 merv admin 136 Oct 2 11:13 /Library/QuickTime/Toast Video CD Support.qtx.diasbled/Contents/MacOSClassic quicktimestreaming installed)
__________________
On a clear disk, you can seek forever. |
|
|
|
|
|
#5 |
|
Triple-A Player
Join Date: Jul 2002
Location: Louisiana
Posts: 208
|
Dern permissions...
|
|
|
|
![]() |
|
|