|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VFS (Virtual File System) permission denied
Hi, I'm trying to use VFS (with PHP5, Linux), and have this problem:
Warning: file_get_contents(/home/mario/Desktop/prueba.txt) [function.file-get-contents]: failed to open stream: Permission denied in /usr/share/php/VFS/sql_file.php on line 72 Here is the code of /usr/share/php/VFS/sql_file.php (line 72 included): function read($path, $name) { $conn = $this->_connect(); if (is_a($conn, 'PEAR_Error')) { return $conn; } $file = $this->_getNativePath($path, $name); if (function_exists('file_get_contents')) { $data = file_get_contents($file); //THIS IS LINE 72 } else { $fp = @fopen($file, 'rb'); if (!$fp) { return PEAR::raiseError(_("Unable to open VFS file.")); } $data = fread($fp, filesize($file)); fclose($fp); } return $data; } I used data/vfs.sql to create the "vfs" table in the "vfs" database in mysql. I can see I have a problem with permissions but don't know how to work it out. The file I want to read is "/home/mario/Desktop/prueba.txt", and my code is: Code: <?php require_once('HTML/Template/Sigma.php'); require_once('VFS.php'); require_once('VFS/sql_file.php'); $array = array(phptype => 'mysql', vfsroot => '', table => 'vfs', hostspec => 'localhost', database => 'vfs', username => 'mario', password => '', ); $vfs = new VFS_sql_file($array); $vfs->_permissions = array( 'owner' => array('read' => true, 'write' => true, 'execute' => true), 'group' => array('read' => true, 'write' => true, 'execute' => true), 'all' => array('read' => true, 'write' => true, 'execute' => true)); $res = $vfs->read('/home/mario/Desktop/', 'prueba.txt'); echo "Resultado: " . $res; ?> Any idea? |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > VFS (Virtual File System) permission denied |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|