We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Error

Yes I have. There are no entries for the domain.

Drew McLellan

Drew McLellan 2637 points
Perch Support

That fatal error you're reporting is logged though, right? If not, your logs aren't working.

I'm looking at the standard server logs. Is there some special PHP log I need to enable?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Probably, but you would need to ask your host how to do that as it depends on your hosting setup. I wrote this article which is still relevant in most cases on shared hosting http://www.smashingmagazine.com/2011/11/30/a-guide-to-php-error-messages-for-designers/

I'll try setting up the PHP error reporting. I the meantime, I did find the Error in the regular error log, as follows:

"[Tue Jul 07 09:56:25 2015] [error] [client 71.189.216.125] PHP Fatal error: Class 'PerchResources' not found in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/perch/core/apps/content/modes/edit.form.pre.php on line 79, referer: http://dev-literarywomen.org.s70481.gridserver.com/perch/core/apps/content/page/?id=10"

But that doesn't really tell us anything new.

I've setup the PHP error reporting per Rachel's post (simple, thanks!), but it returns pretty much the same information:

[07-Jul-2015 10:49:07 America/Los_Angeles] PHP Fatal error: Class 'PerchResources' not found in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/perch/core/apps/content/modes/edit.form.pre.php on line 79

Drew McLellan

Drew McLellan 2637 points
Perch Support

Are you logging warnings?

Basically there's something unusual about how your server is configured and we need to understand what error is leading up to this one.

Drew,

I'm using "php_value error_reporting -1" now which gives me the following:

[07-Jul-2015 10:49:07 America/Los_Angeles] PHP Fatal error: Class 'PerchResources' not found in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/perch/core/apps/content/modes/edit.form.pre.php on line 79 [07-Jul-2015 10:49:36 America/Los_Angeles] PHP Fatal error: Class 'PerchResources' not found in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/perch/core/apps/content/modes/edit.form.pre.php on line 79 [08-Jul-2015 09:03:10 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 34 [08-Jul-2015 09:03:11 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 80 [08-Jul-2015 09:03:15 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 34 [08-Jul-2015 09:03:15 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 80 [08-Jul-2015 09:03:15 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 34 [08-Jul-2015 09:03:15 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 80 [08-Jul-2015 09:03:19 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 34 [08-Jul-2015 09:03:19 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 80 [08-Jul-2015 09:03:20 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 34 [08-Jul-2015 09:03:20 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 80 [08-Jul-2015 09:04:01 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 34 [08-Jul-2015 09:04:01 America/Los_Angeles] PHP Notice: Use of undefined constant yes - assumed 'yes' in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/festival.php on line 80 [08-Jul-2015 09:04:12 America/Los_Angeles] PHP Fatal error: Class 'PerchResources' not found in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/perch/core/apps/content/modes/edit.form.pre.php on line 79 [08-Jul-2015 09:05:56 America/Los_Angeles] PHP Fatal error: Class 'PerchResources' not found in /nfs/c05/h03/mnt/70481/domains/dev-literarywomen.org/html/perch/core/apps/content/modes/edit.form.pre.php on line 79

Not sure if that adds anything useful. The server is a stock MediaTemple GRID server with a MySQL Container and has been running Perch sites for years.

Thanks!

Rachel Andrew

Rachel Andrew 394 points
Perch Support

The file /perch/core/lib/PerchResources.class.php does exist on your server, and contains a PHP function of the same name?

Rachel,

No. There's a /perch/core/lib/PerchResource.class.php file, however (singular, rather than plural on the "Resource")

It's contents are:

<?php

class PerchResource extends PerchBase { protected $table = 'resources'; protected $pk = 'resourceID';

private $clean_resources = true;

function __construct($details) 
{        
    if (defined('PERCH_CLEAN_RESOURCES')) $this->clean_resources = PERCH_CLEAN_RESOURCES;
    return parent::__construct($details);
}

public function delete()
{
    if ($this->clean_resources && !$this->resourceInLibrary()) {
        $Perch  = Perch::fetch();
        $bucket = $Perch->get_resource_bucket($this->resourceBucket());

        $file_path = PerchUtil::file_path($bucket['file_path'].'/'.$this->resourceFile());

        if (file_exists($file_path) && !is_dir($file_path)) {
            unlink($file_path);
            PerchUtil::debug('Deleting resource: '.$file_path);
        }
    }

    return parent::delete();
}

}

Rachel Andrew

Rachel Andrew 394 points
Perch Support

You are missing a file then.

I would re-download Perch and be sure that you have uploaded everything from perch/core.

SOLUTION BELOW

It turns out that Transmit (for FTP transfer) didn't upload both the PerchResources.class.php file AND the PerchAPI_Resources.class.php file due to a rule in the preferences to skip any files with "resources" in the title.

Where that rule came from, I have no idea.

Everything now works smoothly. Thanks!

Drew McLellan

Drew McLellan 2637 points
Perch Support

That was why I'd asked if the file was there - you said it was!

Very true. In my check, I didn't discern between PerchResource.class.php and PerchResources.class.com.