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?

I would recommend that you upgrade to current (1.15.2) or at leas the most current in the branch that you are running and re-test.

10 days later

I upgraded to 1.14.6. Still receiving the same error. Will continue looking for a solution, but any help is appreciated.

    OkieRazorback
    nginx is not supported by out of the box, so you may need to make some changes or maybe PHP version upgrade might fix?

    13 days later

    Turns out it is an nginx issue. Our sysadmin is working on a solution (I'm pushing to just use Apache, but...).

    You can close this post.

    Write a Reply...