Answer the question
In order to leave comments, you need to log in
Php does not see classes after installing the site on hosting, what should I do?
Hello! I have a simple code, everything works on the local machine. I decided to throw it on the hosting and everything broke. I'm using composer's autoloader (psr-4).
Error:
PHP Fatal error: Uncaught Error: Class 'shop\\core\\App' not found in /home/s/s91027o5/s91027o5.beget.tech/public_html/index.php:5\nStack trace:\n#0 {main}\n thrown in /home/s/s91027o5/s91027o5.beget.tech/public_html/index.php on line 5.
Index.php code:
<?php
use shop\core\App;
require '../vendor/autoload.php';
$app = new App();
$app->start();
class App
{
public function start(){
$request = new Request();
$controllerName = $request->getController();
$controller = new $controllerName;
$method = $request->getMethod();
$controller->$method();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question