时间本地时间[关闭]

I just transfer my cms to new os server which as below:

Apache24 PHP5.5.14 MySql

When I login to management area with username and password on /index.php I press submit the page redirect to same page with blank page with showing number '1' on that page. Basicly it will redirect to main/manage.php .

I check php error log and found as below:

PHP Notice:  Use of undefined constant TIME_LOCAL_TIME - assumed 'TIME_LOCAL_TIME' in J:\WebDocs\gad\manage\index.php on line 15

Here is php code start with line 10 to 17

{
    $userId = getSessionArrayValue('UserId');
    $ip = getServerArrayValue('REMOTE_ADDR');
    $action = "Logged in user name: $username";
    $db->addlog($userId, $ip, $action, TIME_LOCAL_TIME);
    redirect("main/manage.php");
}

Is this issues relate to php version? what should I do to fix this.

I think TIME_LOCAL_TIME is constant defined in your OLD system. Is not a php error. It's clear a Warning. TIME_LOCAL_TIME is not defined. Searching "TIME_LOCAL_TIME" in php.net, I did not get any result. So, I think it's just and old configuration.

I suggest to define constant in your code, and not in server. The reason is that if you change server, you must remember to fix configurations. Also, you can automate this stuff. Automatic, (can) remove the possibility of "failure" and/or human distractions.

There is missing in PHP version 5.5.14

; This directive allows you to enable and disable warnings which PHP will issue
; if you pass a value by reference at function call time. Passing values by
; reference at function call time is a deprecated feature which will be removed
; from PHP at some point in the near future. The acceptable method for passing a
; value by reference to a function is by declaring the reference in the functions
; definition, not at call time. This directive does not disable this feature, it
; only determines whether PHP will warn you about it or not. These warnings
; should enabled in development environments only.
; Default Value: On (Suppress warnings)
; Development Value: Off (Issue warnings)
; Production Value: Off (Issue warnings)
; http://php.net/allow-call-time-pass-reference
allow_call_time_pass_reference = Off

; Safe Mode
; http://php.net/safe-mode
safe_mode = Off

; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
; http://php.net/safe-mode-gid
safe_mode_gid = Off

; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
; http://php.net/safe-mode-include-dir
safe_mode_include_dir =

; When safe_mode is on, only executables located in the safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
; http://php.net/safe-mode-exec-dir
safe_mode_exec_dir =

; Setting certain environment variables may be a potential security breach.
; This directive contains a comma-delimited list of prefixes.  In Safe Mode,
; the user may only alter environment variables whose names begin with the
; prefixes supplied here.  By default, users will only be able to set
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
; Note:  If this directive is empty, PHP will let the user modify ANY
;   environment variable!
; http://php.net/safe-mode-allowed-env-vars
safe_mode_allowed_env_vars = PHP_

; This directive contains a comma-delimited list of environment variables that
; the end user won't be able to change using putenv().  These variables will be
; protected even if safe_mode_allowed_env_vars is set to allow to change them.
; http://php.net/safe-mode-protected-env-vars
safe_mode_protected_env_vars = LD_LIBRARY_PATH

Now working as usual.