0

I try to run an php website on a raspberryPi (linux debian) in an apache docker container. I use vs code with folowing extensions: 'PHP Debug' and 'PHP Intelephense'.

When I run the site on my windows pc te project works, when I try to run the site on te server I get the following error message:

Fatal error: Uncaught Error: Class "app\core\Request" not found in /var/www/test/core/Application.php:19 Stack trace: #0 /var/www/test/public/index.php(8): app\core\Application->__construct('/var/www/test_p...') #1 {main} thrown in /var/www/test/core/Application.php on line 19``

My map structur:

App
-Core
--Applicatoin.php
--Controller.php
--request.php
--response.php
--Router.php
-src
--controller
---HomeController.php
--models
--views
---home.php
-public
--index.php

The code it is refering to:
(core/Applicatoin.php)

<?php

namespace app\core;

use Dotenv\Loader\Resolver;

class Application
{
    public static string $ROOT_DIR;
    public Router $router;
    public Request $request;
    public Response $response;
    public static Application $app;

    public function __construct($rootPath)
    {
        self::$ROOT_DIR = $rootPath;
        self::$app = $this;
        $this->request = new Request();
        $this->response = new Response();
        $this->router = new Router($this->request, $this->response);
    }

    public function run()
    {
        echo $this->router->resolve();
    }
}

What am I doing wrong?

Bjop
  • 330
  • 4
  • 19

0 Answers0