
I'm trying to run /usr/bin/php /path/to/osticket/api/cron.php (I am replacing /path/to/osticket/ with the proper path) and receiving the following error:
PHP Fatal error: Uncaught ErrorException:
Undefined index: SERVER_PORT in /var/www/osticket/upload/include/class.misc.php on line 243
in /usr/local/lib/php/common.php:183
Stack trace:
#0 /var/www/osticket/upload/include/class.misc.php(243): errHandle(8, 'Undefined index...', '/var/www/ostick...', 243, Array)
#1 /var/www/osticket/upload/bootstrap.php(370): Misc::currentURL()
#2 /var/www/osticket/upload/main.inc.php(23): require('/var/www/ostick...')
#3 /var/www/osticket/upload/api/api.inc.php(26): require_once('/var/www/ostick...')
#4 /var/www/osticket/upload/api/cron.php(17): require('/var/www/ostick...')
#5 {main}
thrown in /usr/local/lib/php/common.php on line 183
Based on my investigation the method Misc::currentURL found in class.misc.php and called from bootstrap.php is trying to get the port from the $_SERVER array. However, my understanding is the SERVER_PORT is not present in $_SERVER array when php is being run from the CLI.
So, what am I missing? I know other people are using cron.php. How are they getting around this issue?
Is there a configuration step that was missed on install/configuration?