--- Wade Smart <[EMAIL PROTECTED]> wrote:

> Im doing a tutorial on reading and writing files.
> Im on Ubuntu linux.
> 
> The tutorial said that the file must already exist so that you 
> can set the permissions on it. So I created a file and set the 
> user and group to www-data. I set the permissions as 0666. I 
> can write to the file. I cannot read from it. I have the 
> ini_set to display errors and error reporting set to E_ALL & 
> ~E_NOTICE. When I attempt to read the file nothing
> is on the page and in the code there is only <p></p>.
> 
> Would someone give me a pointer on this.
> 
> Thanks.
> 
> Wade

I assume that your Apache web server is running as the user www-data on Ubuntu? 
 If so, you won't
need 666 (-rw-rw-rw-) permissions on the file since you have changed the 
ownership.  You could set
it to 600 (-rw-------) and it should still work.

However, this does not address your inability to read the file with PHP.  Is 
the file in the web
space?  If so, can you read it directly with a browser pointing to a 
corresponding URL?

If the file is outside of the web space there is a chance that safe_mode is on 
in php.ini which
would prevent PHP programs from reading files owned by a different user than 
the PHP script.

If you use:

error_reporting(E_ALL);

at the top of your program you should see all of the errors, including any 
safe_mode violations.

James
_____


James D. Keeline
http://www.Keeline.com  http://www.Keeline.com/articles
http://Stratemeyer.org  http://www.Keeline.com/TSCollection

http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Fall Semester Begins Sep 7 -- New Classes Start Every Few Weeks.
Spring Semester Begins in late January.  Two new class topics.


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to