You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-02-07 14:41:31

eliglpi
Member
Registered: 2019-02-25
Posts: 4

Problems after ubuntu 20.04 to 22.04 distro upgrade

Hello

i did glpi update 10.0.9 to 10.0.12 that went good and after that i got warning: PHP 7.4 is no longer maintained by its community.
OK, so i thought instead of adding php repos i just do ubuntu distro upgrade from 20.04->22.04 as it will update php too. But after ubuntu distro upgrade i get error on my glpi website:

. * * --------------------------------------------------------------------- */ /** * GLPI web router. * * This router is used to be able to expose only the `/public` directory on the webserver. */ $glpi_root = realpath(dirname(__FILE__, 2)); if (preg_match('/^\/public/', $_SERVER['REQUEST_URI']) !== 1 && $_SERVER['SCRIPT_NAME'] === '/public/index.php') { // When requested URI does not start with '/public' but `$_SERVER['SCRIPT_NAME']` is '/public/index.php', // it means that document root is the GLPI root directory, but a rewrite rule redirects the request to the PHP router. // This case happen when redirection to PHP router is made by an `.htaccess` file placed in the GLPI root directory, // and has to be handled to support shared hosting where it is not possible to change the web server root directory. $uri_prefix = ''; } else { // `$_SERVER['SCRIPT_NAME']` corresponds to the script path relative to server document root. // -> if server document root is `/public`, then `$_SERVER['SCRIPT_NAME']` will be equal to `/index.php` // -> if script is located into a `/glpi-alias` alias directory, then `$_SERVER['SCRIPT_NAME']` will be equal to `/glpi-alias/index.php` $uri_prefix = rtrim(str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])), '/'); } // Get URI path relative to GLPI (i.e. without alias directory prefix). $path = preg_replace( '/^' . preg_quote($uri_prefix, '/') . '/', '', parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ); require $glpi_root . '/src/Http/ProxyRouter.php'; $proxy = new \Glpi\Http\ProxyRouter($glpi_root, $path); if ($proxy->isTargetAPhpScript() && $proxy->isPathAllowed() && ($target_file = $proxy->getTargetFile()) !== null) { // Ensure `getcwd()` and inclusion path is based on requested file FS location. chdir(dirname($target_file)); // Redefine some $_SERVER variables to have same values whenever scripts are called directly // or through current router. $target_path = $uri_prefix . $proxy->getTargetPath(); $target_pathinfo = $proxy->getTargetPathInfo(); $_SERVER['PATH_INFO'] = $target_pathinfo; $_SERVER['PHP_SELF'] = $target_path; $_SERVER['SCRIPT_FILENAME'] = $target_file; $_SERVER['SCRIPT_NAME'] = $target_path; // Execute target script. require($target_file); exit(); } $proxy->proxify();

For now i did rollback to ubuntu 20.04 but would be good to know how to fix this.

Thank you!

Offline

#2 2024-02-08 01:56:05

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,459
Website

Re: Problems after ubuntu 20.04 to 22.04 distro upgrade

You forgot to install/enable the PHP module in Apache that matches the new PHP version?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2024-02-08 09:06:15

eliglpi
Member
Registered: 2019-02-25
Posts: 4

Re: Problems after ubuntu 20.04 to 22.04 distro upgrade

Yes, you are correct, needed to enable new php module in apache.
Thank you!

Offline

Board footer

Powered by FluxBB