Jump to content

Recommended Posts

So I'm editing a previous coder's code, and I'm running into these errors:

 

Warning: file_put_contents(./cache/model_60054fad9b14fb9a3ef6a039e98e2237): failed to open stream: Permission denied in [fullpath]/inc/acorn.php on line 1427

 

Warning: fopen(./cache/model_60054fad9b14fb9a3ef6a039e98e2237): failed to open stream: No such file or directory in [fullpath]/inc/acorn.php on line 1304

 

Warning: include(anmodel:///[fullpath]/inc/models/member.php): failed to open stream: "AN_ModelStream::stream_open" call failed in [fullpath]/inc/acorn.php on line 161

 

Warning: include(): Failed opening 'anmodel:///[fullpath]/inc/models/member.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in [fullpath]/inc/acorn.php on line 161

 

Fatal error: Class 'Member' not found in [fullpath]/inc/user_page.php on line 7

 

I'm guessing they all stem from that initial file_put_contents(), and here is the relevant code (I think):

 

    class AN_ViewStream extends AN_Stream
    {
    function stream_open($path, $mode, $options, &$opened_path)
    {
	    $cache = self::cache_path('view_'.md5($path));
	    $path = self::stream_path($path);

	    if (file_exists($cache) === false || filemtime($path) > filemtime($cache))
	    {
		    $view_data = file_get_contents($path);

		    if (ini_get('short_open_tag') == false)
		    {
			    $view_data = preg_replace(array('/<\?(?!php)/i', '/<\?php=/i'), array('<?php', '<?php echo '), $view_data);
		    }

		    file_put_contents($cache, $view_data);
	    }

	    if (parent::stream_open($cache, $mode, $options, $opened_path))
	    {
		    $opened_path = $path;

		    return true;
	    }

	    return false;
    }
    }

 

I'm guessing a chmod of some sort is in order?  But I'm really not even sure what directory I should be changing the permissions of.  If you need to see more code, let me know, but can anyone lend a helping hand to point me in the right direction?  Thanks.

Link to comment
https://forums.phpfreaks.com/topic/266388-not-sure-what-the-problem-is-here/
Share on other sites

Yes, the first step should be to verify read/write permissions to the files. general files should be 664 (read/write owner & server group, read by others) and directories 755 ( read/write/execute owner, read/execute group, read others ). depending on how the server is set up, you may need extended permissions on your cache folders.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.