Whoops \ Exception \ ErrorException (E_NOTICE)
date_default_timezone_set(): Timezone ID '/' is invalid Whoops\Exception\ErrorException thrown with message "date_default_timezone_set(): Timezone ID '/' is invalid" Stacktrace: #4 Whoops\Exception\ErrorException in /var/www/html/admin/libraries/BMO/View.class.php:153 #3 date_default_timezone_set in /var/www/html/admin/libraries/BMO/View.class.php:153 #2 FreePBX\View:setTimezone in /var/www/html/admin/bootstrap.php:172 #1 require_once in /etc/freepbx.conf:9 #0 include_once in /var/www/html/admin/config.php:100
Click Here Report this to the PBX bug tracker
Stack frames (5)
4
Whoops
\
Exception
\
ErrorException
/
var
/
www
/
html
/
admin
/
libraries
/
BMO
/
View.class.php
153
3
date_default_timezone_set
/
var
/
www
/
html
/
admin
/
libraries
/
BMO
/
View.class.php
153
2
FreePBX
\
View
setTimezone
/
var
/
www
/
html
/
admin
/
bootstrap.php
172
1
require_once
/
etc
/
freepbx.conf
9
0
include_once
/
var
/
www
/
html
/
admin
/
config.php
100
/
var
/
www
/
html
/
admin
/
libraries
/
BMO
/
View.class.php
  1. /**
  2. * Set System Timezone
  3. */
  4. public function setTimezone($timezone=null) {
  5. if(empty($timezone) && !empty($this->tz)) {
  6. return $this->tz;
  7. }
  8. date_default_timezone_set('UTC');
  9. $freepbxtimezone = $this->freepbx->Config->get('PHPTIMEZONE');
  10. $phptimezone = !empty($timezone) ? $timezone : $freepbxtimezone;
  11. $phptimezone = trim($phptimezone);
  12. $invalidtimezone = false;
  13. if(!empty($phptimezone)) {
  14. $tzi = \DateTimeZone::listIdentifiers();
  15. if(!in_array($phptimezone,$tzi)) {
  16. $invalidtimezone = $phptimezone;
  17. $timezone = 'UTC';
  18. }
  19. date_default_timezone_set($phptimezone);
  20. }
  21. if(!empty($invalidtimezone)) {
  22. //$this->nt->add_warning("framework", "TIMEZONE", _("Unable to set timezone"), sprintf(_("Unable to set timezone to %s because PHP does not support that timezone, the timezone has been temporarily changed to UTC. Please set the timezone in Advanced Settings."),$invalidtimezone), "config.php?display=advancedsettings", true, true);
  23. } else {
  24. //$this->nt->delete("framework", "TIMEZONE");
  25. }
  26. $this->tz = date_default_timezone_get();
  27. return $this->tz;
  28. }
  29. /**
  30. * Get User or System Timezone
  31. * @param int $userid The User Manager ID, if not supplied try to infere it
  32. * @return string The Timezone
  33. */
  34. public function getTimezone() {
  35. if(empty($this->tz)) {
  36. $this->setTimezone();
  37. }
  38. $tz = $this->tz;
/
var
/
www
/
html
/
admin
/
libraries
/
BMO
/
View.class.php
 
    /**
     * Set System Timezone
     */
    public function setTimezone($timezone=null) {
        if(empty($timezone) && !empty($this->tz)) {
            return $this->tz;
        }
        date_default_timezone_set('UTC');
        $freepbxtimezone = $this->freepbx->Config->get('PHPTIMEZONE');
        $phptimezone = !empty($timezone) ? $timezone : $freepbxtimezone;
        $phptimezone = trim($phptimezone);
        $invalidtimezone = false;
        if(!empty($phptimezone)) {
            $tzi = \DateTimeZone::listIdentifiers();
            if(!in_array($phptimezone,$tzi)) {
                $invalidtimezone = $phptimezone;
                $timezone = 'UTC';
            }
            date_default_timezone_set($phptimezone);
        }
        if(!empty($invalidtimezone)) {
            //$this->nt->add_warning("framework", "TIMEZONE", _("Unable to set timezone"), sprintf(_("Unable to set timezone to %s because PHP does not support that timezone, the timezone has been temporarily changed to UTC. Please set the timezone in Advanced Settings."),$invalidtimezone), "config.php?display=advancedsettings", true, true);
        } else {
            //$this->nt->delete("framework", "TIMEZONE");
        }
        $this->tz = date_default_timezone_get();
        return $this->tz;
    }
 
    /**
     * Get User or System Timezone
     * @param  int $userid The User Manager ID, if not supplied try to infere it
     * @return string         The Timezone
     */
    public function getTimezone() {
        if(empty($this->tz)) {
            $this->setTimezone();
        }
        $tz = $this->tz;
/
var
/
www
/
html
/
admin
/
bootstrap.php
/** TODO Remove this when all modules are finally NOT referencing it like this **/
class Database extends FreePBX\Database {};
 
//Not available until PHP 5.4
if(!defined("ENT_HTML401")) {
    define("ENT_HTML401", 0);
}
 
// bootstrap.php should always be called from freepbx.conf so
// database conifguration already included, connect to database:
//
require_once(dirname(__FILE__)."/libraries/DB.class.php");
global $db;
$db = new DB();
 
// get settings
$freepbx_conf = $bmo->Freepbx_conf();
 
//set this before we run date functions
$timezone = $bmo->View->setTimezone();
 
// passing by reference, this means that the $amp_conf available to everyone is the same one as present
// within the class, which is probably a direction we want to go to use the class.
//
$bootstrap_settings['amportal_conf_initialized'] = false;
$amp_conf = $freepbx_conf->parse_amportal_conf("/etc/amportal.conf",$amp_conf);
 
if($amp_conf['PHP_CONSOLE']) {
    $connector = PhpConsole\Connector::getInstance();
    if(!empty($amp_conf['PHP_CONSOLE_PASSWORD'])) {
        $connector->setPassword($amp_conf['PHP_CONSOLE_PASSWORD']);
    }
    $handler = PhpConsole\Handler::getInstance();
    $handler->start();
}
 
$amp_conf['PHP_ERROR_LEVEL'] = !empty($amp_conf['PHP_ERROR_LEVEL']) ? $amp_conf['PHP_ERROR_LEVEL'] : "ALL_NOSTRICTNOTICE";
switch($amp_conf['PHP_ERROR_LEVEL']) {
    case "ALL":
        error_reporting(E_ALL);
/
etc
/
freepbx.conf
<?php
$amp_conf['AMPDBUSER'] = 'freepbxuser';
$amp_conf['AMPDBPASS'] = '0acafd6cedf9a128ec7777d459137e93';
$amp_conf['AMPDBHOST'] = 'localhost';
$amp_conf['AMPDBNAME'] = 'asterisk';
$amp_conf['AMPDBENGINE'] = 'mysql';
$amp_conf['datasource'] = ''; //for sqlite3
 
require_once('/var/www/html/admin/bootstrap.php');
?>
 
/
var
/
www
/
html
/
admin
/
config.php
 
//session_cache_limiter('public, no-store');
if (isset($_REQUEST['handler'])) {
    if ($restrict_mods === false) {
        $restrict_mods = true;
    }
    switch ($_REQUEST['handler']) {
    case 'api':
        break;
    default:
        // If we didn't provide skip_astman in the $_REQUEST[] array it will be boolean false and for handlers, this should default
        // to true, if we did provide it, it will NOT be a boolean (it could be 0) so we will honor the setting
        //
        $bootstrap_settings['skip_astman'] = $bootstrap_settings['skip_astman'] === false ? true : $bootstrap_settings['skip_astman'];
        break;
    }
}
 
// call bootstrap.php through freepbx.conf
include_once '/etc/freepbx.conf';
 
//check to make sure zend files aren't breaking the SPL autoloader.
//if they are then tell the user to run said command below
//which disables any zend module that breaks the autoloader
if(function_exists('SPLAutoloadBroken') && SPLAutoloadBroken()) {
    //note this has to be done outside of freepbx_die
    die(_("The autoloader is damaged. Please run: ".$amp_conf['AMPBIN']."/fwconsole --fix_zend"));
}
 
$d = FreePBX::View()->setAdminLocales();
$timezone = $d['timezone'];
$language = $d['language'];
 
// At this point, we have a session, and BMO was created in bootstrap, so we can check to
// see if someone's trying to programatically log in.
if ($unlock) {
    if ($bmo->Unlock($unlock)) {
        unset($no_auth);
        $display = 'index';
    }

Environment & details:

empty
empty
empty
Key Value
PHPSESSID t7bkstbluvhuj0uoj0vdeldk50
_ga GA1.1.1976804584.1500561459
_gid GA1.1.660124564.1500561459
Key Value
langdirection ltr
module_name sysadmin
module_page sysadmin
AMP_user ampuser Object ( [username] => admin [id] => [password:ampuser:private] => 12c3cab4f6408d5b255b316cd27b8672be43fe86 [extension_high:ampuser:private] => [extension_low:ampuser:private] => [sections:ampuser:private] => Array ( [0] => * ) [mode:ampuser:private] => database [opmode:ampuser:private] => [lang] => [tz] => [dateformat] => [timeformat] => [datetimeformat] => [_lastactivity] => 1500650972 )
Key Value
UNIQUE_ID WXInWhNq--1fX5zdoEj0KQAAAAE
SCRIPT_URL /admin/config.php
SCRIPT_URI http://10.0.5.53/admin/config.php
HTACCESS on
HTTP_HOST 10.0.5.53
HTTP_CONNECTION keep-alive
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_USER_AGENT Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
HTTP_ACCEPT_ENCODING gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.8
HTTP_COOKIE PHPSESSID=t7bkstbluvhuj0uoj0vdeldk50; _ga=GA1.1.1976804584.1500561459; _gid=GA1.1.660124564.1500561459
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE Apache/2.4.6 (Sangoma) OpenSSL/1.0.1e-fips PHP/5.6.31
SERVER_NAME 10.0.5.53
SERVER_ADDR 10.0.5.53
SERVER_PORT 80
REMOTE_ADDR 10.0.5.108
DOCUMENT_ROOT /var/www/html
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /var/www/html
SERVER_ADMIN root@sangoma.localhost
SCRIPT_FILENAME /var/www/html/admin/config.php
REMOTE_PORT 49172
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /admin/config.php
SCRIPT_NAME /admin/config.php
PHP_SELF /admin/config.php
REQUEST_TIME_FLOAT 1500653402.405
REQUEST_TIME 1500653402
empty
0. Whoops\Handler\PrettyPageHandler