• I have written a script in php that adds data to a text file so I can parse it in the wordpress index page but every time the script runs and tries to fwrite a new bit of text to the file I get a “failed to open stream: Permission denied in ” message.

    is this to do with my htaccess file?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    No, it’s more likely to do with the permissions on the text file. Give it 644 permissions. If that fails, give it 664 permissions. If that fails, give it 666 permissions. If even that fails, talk to your host and ask them what permissions it should have to be writable by the webserver process.

    Use the smallest permissions number that actually works.

    Thread Starter teamplaylotto

    (@teamplaylotto)

    fantastic!
    i got to 666 and it worked. I always thought that 755 would be bestest.

    thanks for your help, all is working now and the site is much faster now I don’t have to parse a remote file.

    Andy

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘access denied for custom php script using fwrite’ is closed to new replies.