sasanrose / phpredmin

Yet another web interface for Redis
BSD 3-Clause "New" or "Revised" License
404 stars 96 forks source link

Undefined index REQUEST_METHOD and HTTP_HOST while running the cron job #85

Closed markus-perl closed 7 years ago

markus-perl commented 7 years ago

Running the cron job throws a PHP notice "undefined index" because the $_SERVER['REQUEST_METHOD'] and the $_SERVER['HTTP_HOST'] variable are not set when running in cli mode.

[11-Jan-2017 22:00:01 Europe/Amsterdam] PHP Notice:  Undefined index: HTTP_HOST in /var/www/phpredmin/libraries/router.php on line 37
[11-Jan-2017 22:01:01 Europe/Amsterdam] PHP Notice:  Undefined index: REQUEST_METHOD in /var/www/phpredmin/libraries/router.php on line 31
sasanrose commented 7 years ago

@markus-perl Thanks for the pull request and sorry for the delay

Markus there is a mege conflict that need to be resolved. I can resolve that, however, can you please move you code inside if statement to the existing one?

sasanrose commented 7 years ago

Also there is a work around for this in https://github.com/sasanrose/phpredmin/issues/10

markus-perl commented 7 years ago

Hi sasanrose, The merge conflict should be fixed. I'm running the cron job directly from the command line, there is no nginx/apache involved, so I don't think that the workaround will have any impact on this issue.