I developed a system with symfony 5 and now I have deployed to hosting. Migrate the files by fpt and everything is perfect. However, when I run the system I get the following error:
Uncaught LogicException: Extension DOM is required.
The system in the hosting is in php 7.4 On the other hand, my index file is configured as:
<?php
use App\Kernel;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;
require '/home12/eisenluk/symfony/config/bootstrap.php';
require '/home12/eisenluk/symfony/vendor/autoload.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
On the other hand my .htaccess file set my env:
SetEnv APP_ENV prod
SetEnv DATABASE_URL 'mysql://eisenluk_user:Hm2DsQL9h@[email protected]:3306/eisenluk_sql'
If you can guide me on how to configure it, thank you!
It seems that you are missing the DOM extension, as indicated by the error message
https://www.php.net/manual/en/intro.dom.php
If your server runs on Ubuntu, you can install it by running:
Otherwise you should see how to install that PHP extension in the OS that runs your hosting. Cheers