When writing a PHP File Upload program, the following warning is reported:
Upload: screen 2014-09-28_160214.png type: image/pngsize: 66.84765625 kbtemp file: D: \ Users \ Aven \ appdata \ Local \ temp \ php742f. tmpwarning: move_uploaded_file () [function. move-uploaded-file]: it is not safe to rely on the system's timezone settings. you are * required * to use the date. timezone setting or the date_default_timezone_set () function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we selected 'utc' for '8. 0/No DST 'Instead in F: \ PHP \ upload_file.php on line 26 warning: move_uploaded_file (upload/screen 2014-09-28_160214.png) [function. move-uploaded-file]: failed to open stream: no such file or directory in F: \ PHP \ upload_file.php on line 26 warning: move_uploaded_file () [function. move-uploaded-file]: it is not safe to rely on the system's timezone settings. you are * required * to use the date. timezone setting or the date_default_timezone_set () function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we selected 'utc' for '8. 0/No DST 'Instead in F: \ PHP \ upload_file.php on line 26 warning: move_uploaded_file () [function. move-uploaded-file]: Unable to move 'd: \ Users \ Aven \ appdata \ Local \ temp \ php742f. TMP 'to 'upload/screen 2014-09-28_160214.png 'in F: \ PHP \ upload_file.php on line 26 stored in: Upload/screen 2014-09-28_160214.png
This is because the time taken by PHP is Greenwich mean time, so there will be a difference between the GMT Standard Time and the Beijing time by about eight hours. We can solve this problem as follows:
1. Use date_default_timezone_set () in the page header to set my default time zone to Beijing time, that is, <? PHP date_default_timezone_set ("PRC");?> You can.
2. in PHP. set date in ini. the value of timezone is PRC, and the value after setting is date. timezone = PRC, cancel the comments of this line of code at the same time, that is, remove the semicolon above.
Here we use the method of modifying the configuration file to solve the problem:
Use Notepad ++ to open PHP. ini,
Find "date. timezone", remove the semicolon before the statement, set the value to "PRC", restart the FastCGI service, and solve the problem.
It is not safe to rely on the system's timezone settings