Re: [PHP-DB] Writing Problems

2014-08-27 Thread Matt Pelmear
/***/ $fp = fopen('filename.txt', 'a+'); // The correct thing to do is: if (! $fp) throw new Exception( 'Something went wrong opening the file' ); // Otherwise, you can also check with: if (! is_resource($fp)) throw new Exception( 'Something went

[PHP-DB] Writing Problems

2014-08-26 Thread Ethan Rosenberg
Dear List - I can't figure this one out. 1] Straighten out ownership ethan@meow:/var/www$ rm receipt.txt ethan@meow:/var/www$ touch receipt.txt ethan@meow:/var/www$ ls -l receipt.txt -rw-r--r-- 1 ethan ethan 0 Aug 26 19:31 receipt.txt ethan@meow:/var/www$ chmod 766 receipt.txt

Re: [PHP-DB] Writing Problems

2014-08-26 Thread Matt Pelmear
Do you check whether $fh2 is a resource after you fopen()? btw, a better way than: $ chown ethan:ethan filename.txt Might be: $ chown ethan:www-data filename.txt $ chmod 664 filename.txt This way you own the file, the server can write to it (assuming your server has group www-data), and it is