Skip to content

Main v11 Class not found autoloader #18149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks
EORIS-SUPPORT opened this issue Oct 29, 2024 · 5 comments · Fixed by #19520
Closed
2 tasks

Main v11 Class not found autoloader #18149

EORIS-SUPPORT opened this issue Oct 29, 2024 · 5 comments · Fixed by #19520
Assignees

Comments

@EORIS-SUPPORT
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

11

Bug description

After install GLPI v11 in cli
Error 500
image
Error apache
image

Relevant log output

No response

Page URL

No response

Steps To reproduce

  1. install with cli
  2. login GLPI
  3. Error 500 after login

Your GLPI setup information

No response

Anything else?

No response

@cedric-anne
Copy link
Member

Hi,

This error is probably due to the fact that the webserver is not correctly configured. In GLPI 11.0, your document root have to be the public directory and all requests have to be redirected to the public/index.php. See https://glpi-install.readthedocs.io/en/latest/prerequisites.html#web-server for web server configuration examples.

@EORIS-SUPPORT
Copy link
Author

Exactly it's working now thanks @cedric-anne

@cedric-anne cedric-anne self-assigned this Oct 29, 2024
@cedric-anne
Copy link
Member

We will probably have to put back a file to be included in all our front legacy scripts to check whether the webserver is correctly configured. Waiting for #18141 to be merged to have less files to update.

cedric-anne added a commit to cedric-anne/glpi that referenced this issue Apr 16, 2025
@cedric-anne
Copy link
Member

If we want to prevent this kind of errors to be displayed when the web server is misconfigured, once #19483 is merged, we could include a file, in all of our front file, that displays the dedicated error page:

require_once(__DIR__ . '/_check_webserver_config.php');
// /front/_check_webserver_config.php

if (!class_exists('Glpi\\Kernel\\Kernel', autoload: false)) {
    // `Glpi\Kernel\Kernel` class will exists if the request was processed by the `/public/index.php` file,
    // and will not be found otherwise.
    http_response_code(404);
    readfile(__DIR__ . '/../index.html');
    exit();
}

This solution is pretty simple, and will probably have 0 impact on performances. It will not handle plugin files, but I guess plugins files are not the most common entrypoint used when GLPI has just been deployed on a webserver.

@AdrienClairembault, @trasher, is this solution is OK for you?

@trasher
Copy link
Contributor

trasher commented Apr 17, 2025

Looks good to me, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants