Fopen failed to open stream: Permission denied

UPDATE:

So only some of the images aren't loading, is this a resource issue then?

I imported a mysql database from my previous host for use with the image gallery software (PHP based) for my site.

However, when it tries to pull the images from the database I get:

Warning: fopen(sql.log) [function.fopen]: failed to open stream: Permission denied in /srv/www/memefolder.com/public_html/core/util.inc.php  on line 164

Warning: fwrite(): supplied argument is not a valid stream resource in /srv/www/memefolder.com/public_html/core/util.inc.php on line 165

Warning: fclose(): supplied argument is not a valid stream resource in /srv/www/memefolder.com/public_html/core/util.inc.php on line 166

I'm guessing that this is a permissions issue, though I set everything in the public_html directly to 777.

I did a fresh test install of the site (with a new database) and everything works… this greatly confuses me :?

I'm pretty much a complete newbie when dealing with this sort of thing, so any help is greatly appreciated.

1 Reply

PHP is telling you what the problem is:

> Warning: fopen(sql.log) [function.fopen]: failed to open stream: Permission denied in /srv/www/memefolder.com/public_html/core/util.inc.php on line 164

PHP does not have permission to access "sql.log". Wherever that file is, make sure that the user that PHP runs under (usually the same as your webserver, which in my case is www-data) has permission to access that file.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct