apark
apark

Reputation: 73

Class Page Not Found in PHP Application

PHP Application running as docker container throws below error under increased load. Unable to figure out the root cause. Any advice would help?

PHP Fatal error: Uncaught Error: Class 'Page' not found in /var/www/html/vendor/silverstripe/errorpage/src/ErrorPage.php

This is the code of ErrorPage.php:

<?php  
namespace SilverStripe\ErrorPage;

use Page;
use SilverStripe\Assets\File;
use SilverStripe\Assets\Storage\GeneratedAssetHandler;
use SilverStripe\CMS\Controllers\ModelAsController;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Control\HTTPResponse_Exception;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Debug;

class ErrorPage extends Page
{
.....
}

Upvotes: 1

Views: 522

Answers (1)

Gerard de Visser
Gerard de Visser

Reputation: 8050

The Page class is imported with use Page;.

Is there a file named Page.php in the same folder as SilverStripe/ErrorPage.php?

If not then that's the problem and use Page; is not correct and should be changed to the correct path or the file should be created with correct code.

Upvotes: 1

Related Questions