2

I get an php (5.4) warning for this code: fopen("error.log","w");

The warning Warning: fopen(error.log): failed to open stream: Permission denied in ...

The point is, that error.log exists and has 777 rights. What can I do?

I am using Apache2, php 5.4 on an ubuntu 10.04 system

Vic Seedoubleyew
  • 9,888
  • 6
  • 55
  • 76
bernhardh
  • 3,137
  • 10
  • 42
  • 77
  • 1
    Maybe it's in a place outside of PHP's configured "safe" paths.... please provide the full path of the document root and the file you're trying to write to. – imm Jul 07 '12 at 14:19
  • 1
    You need to assign `o+x` permisson for the containing directory as well. – mario Jul 07 '12 at 14:23
  • possible duplicate of [fopen Permission denied on a file with 777 permissions](http://stackoverflow.com/questions/10376048/fopen-permission-denied-on-a-file-with-777-permissions) – mario Jul 07 '12 at 14:24
  • Thanks for the answer.. it was th o+x on the dir – bernhardh Jul 07 '12 at 14:43
  • Possible duplicate of [PHP - Failed to open stream : No such file or directory](http://stackoverflow.com/questions/36577020/php-failed-to-open-stream-no-such-file-or-directory) – Vic Seedoubleyew Sep 11 '16 at 10:01

0 Answers0