Skip to content

php warning Undefined array key "REQUEST_URI" #251

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

Open
2 tasks done
ftoledo opened this issue Oct 11, 2024 · 5 comments
Open
2 tasks done

php warning Undefined array key "REQUEST_URI" #251

ftoledo opened this issue Oct 11, 2024 · 5 comments

Comments

@ftoledo
Copy link

ftoledo commented Oct 11, 2024

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

GLPI Version

10.0.16

Plugin version

1.8.6

Bug description

Php warning where run on cron mode as CLI,

Relevant log output

[2024-10-11 22:37:01] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "REQUEST_URI" in /var/www/glpi/marketplace/mreporting/inc/common
.class.php at line 1768
  Backtrace :
  marketplace/mreporting/inc/graphpng.class.php:112  PluginMreportingCommon::showSelector()
  marketplace/mreporting/inc/graphpng.class.php:805  PluginMreportingGraphpng->initGraph()
  marketplace/mreporting/inc/common.class.php:685    PluginMreportingGraphpng->showPie()
  ...nc/notificationtargetnotification.class.php:119 PluginMreportingCommon->showGraph()
  ...inc/notificationtargetnotification.class.php:54 PluginMreportingNotificationTargetNotification->buildPDF()
  src/NotificationTarget.php:1393                    PluginMreportingNotificationTargetNotification->addDataForTemplate()
  src/NotificationTemplate.php:279                   NotificationTarget->getForTemplate()
  .../mreporting/inc/notificationevent.class.php:112 NotificationTemplate->getTemplateByLanguage()
  ...place/mreporting/inc/notification.class.php:188 PluginMreportingNotificationEvent::raiseEvent()
  src/CronTask.php:1027                              PluginMreportingNotification::cronSendNotifications()
  front/cron.php:87                                  CronTask::launch()

### Your GLPI setup information

Debian 12
php 8.2.24
Copy link

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue.
If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

@github-actions github-actions bot added the Stale label May 21, 2025
@ftoledo
Copy link
Author

ftoledo commented May 21, 2025

any news?

@stonebuzz
Copy link
Contributor

This warning occurs when the REQUEST_URI key is missing from the $_SERVER superglobal. This typically means the script is being executed outside of an HTTP context, where this variable would normally be set by the web server. Common scenarios where this can happen include:

  • Command Line Execution (CLI):
    If the PHP script is run via the command line, e.g., php myscript.php, certain server variables like REQUEST_URI are not available because there is no HTTP request.

  • Scheduled Task (Cron Job):
    Similar to CLI execution, scripts triggered by cron jobs do not originate from an HTTP request, and therefore REQUEST_URI is not defined.

  • Web Server Misconfiguration:
    In rare cases, a misconfiguration in your web server (Apache, Nginx, etc.) might prevent PHP from receiving the necessary environment variables.

Could you please verify your web server configuration? Based on the context, the issue appears to lie outside the plugin itself.

@github-actions github-actions bot removed the Stale label May 22, 2025
Copy link

github-actions bot commented Jun 7, 2025

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue.
If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

@github-actions github-actions bot added the Stale label Jun 7, 2025
@ftoledo
Copy link
Author

ftoledo commented Jun 7, 2025

This appears to be associated with automatic action to send report notification.
All actions are executed in CLI mode without problems with the Linux cron.
With the common setup (* * * * * * php GLPI/front/cron.php)

Only this plugin generates this warning.
Possibly it has been designed to be used in GLPI mode and is not using the CLI correctly.

@github-actions github-actions bot removed the Stale label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants