Fresh 4.4 Cake Installation fails on showing pages: include warning(2)

Hi!

This is my first problem with cakePHP. I have a fresh 4.4 installation, I have already do the bake thing, I have all my Controller, Models, etc… homepage cake test page shows everything working

But when i do a basic test creating a simple page with a basic html or a phpinfo(), i already have it on routes, i get this two warnings:

this is what warnings show:

[Warning (2) ](javascript:void(0);): include(/var/www/mywebsite/app/templates/Pages/lalala.php): Failed to open stream: Permission denied [in /var/www/mywebsite/app/vendor/cakephp/cakephp/src/View/View.php , line 1220 ]


include /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 1220

Cake\View\View::_evaluate() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 1220

Cake\View\View::_render() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 1177

Cake\View\View::render() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 808

Cake\Controller\Controller::render() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/Controller.php, line 773

App\Controller\PagesController::display() /var/www/*mywebsite*/app/src/Controller/PagesController.php, line 65

Cake\Controller\Controller::invokeAction() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/Controller.php, line 547

Cake\Controller\ControllerFactory::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 139

Cake\Controller\ControllerFactory::invoke() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 114

Cake\Http\BaseApplication::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 86

Cake\Http\Middleware\CsrfProtectionMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 174

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Http\Middleware\BodyParserMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Routing\Middleware\RoutingMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 186

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Routing\Middleware\AssetMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Error\Middleware\ErrorHandlerMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 131

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Http\Runner::run() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 67

Cake\Http\Server::run() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Server.php, line 90

[main] /var/www/*mywebsite*/app/webroot/index.php, line 40

[Warning (2) ](javascript:void(0);): include() [function.include]: Failed opening ‘/var/www/mywebsite/app/templates/Pages/lalala.php’ for inclusion (include_path=‘.:/usr/share/php’) [in /var/www/mywebsite/app/vendor/cakephp/cakephp/src/View/View.php , line 1220 ]


include /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 1220

Cake\View\View::_evaluate() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 1220

Cake\View\View::_render() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 1177

Cake\View\View::render() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/View/View.php, line 808

Cake\Controller\Controller::render() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/Controller.php, line 773

App\Controller\PagesController::display() /var/www/*mywebsite*/app/src/Controller/PagesController.php, line 65

Cake\Controller\Controller::invokeAction() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/Controller.php, line 547

Cake\Controller\ControllerFactory::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 139

Cake\Controller\ControllerFactory::invoke() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 114

Cake\Http\BaseApplication::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 86

Cake\Http\Middleware\CsrfProtectionMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 174

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Http\Middleware\BodyParserMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Routing\Middleware\RoutingMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 186

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Routing\Middleware\AssetMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Error\Middleware\ErrorHandlerMiddleware::process() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 131

Cake\Http\Runner::handle() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 82

Cake\Http\Runner::run() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Runner.php, line 67

Cake\Http\Server::run() /var/www/*mywebsite*/app/vendor/cakephp/cakephp/src/Http/Server.php, line 90

[main] /var/www/*mywebsite*/app/webroot/index.php, line 40

Any help on this? Thanks

What URL are you trying to visit when you get this error? What routes have you got set up? What file(s) have you added to support the new “page” you are trying to add?

as I said, i tested a simple html and a phpinfo() on that page, the page is a test page, its called lalala, and it’s on routes.php to:

$builder->connect('/lalala', ['controller' => 'Pages', 'action' => 'display', 'lalala']);
$builder->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);

and here you have lalala.php page:

<!DOCTYPE html>
<html>
    <p>HI</p>
</html>

I know it has no layout, etc… it’s just a test to check it was working, and it isn’t.

include(/var/www/mywebsite/app/templates/Pages/lalala.php): Failed to open stream: Permission denied

As stated in the error message you don’t have the correct permission on your lalala.php file and the user under which your webserver is running is unable to read the file.