0

I am freshgraduate who get new job as developer need your help.

so in my website company has trouble not show week in a years on that form (see the picture). There is logs error on cpanel

 mod_fcgid: stderr: PHP Warning: Unknown: open_basedir restriction in effect. File(/var/cpanel/php/sessions/ea-php56) is not within the allowed path(s): (/var/www/vhosts/xxx.co.id/:/tmp/) in Unknown on line 0, referer: https://www.xxx.co.id/jakarta/modules/presensi2/tambahShift.php

Uncaught exception 'Exception' with message 'DateTime::__construct(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /var/www/vhosts/myweb/public_html/presensi2/tambahShift.php:22, referer: myweb//presensi2/tambahShift.php"

on the line 22 is $data=new DataTime;

what should I do first? Thanks FYI : this website use PHP 5.4.16 version

Trouble not show week(minggu ke-) on form enter image description here

Ojay.123
  • 1
  • 2
  • 1
    Does this answer your question? [open\_basedir restriction in effect. File(/) is not within the allowed path(s):](https://stackoverflow.com/questions/1846882/open-basedir-restriction-in-effect-file-is-not-within-the-allowed-paths) – ariefbayu Oct 18 '20 at 03:09
  • *"has trouble not show week in a years"* ... Please explain your problem a little bit, do you mean that this HTML table `(Tahun, Minggue Ke, Jadwal)` should be filled with rows of data which are missed ? In other words "what do you expect ? and what is the actual results?" – Accountant م Oct 18 '20 at 03:17
  • I mean when we choose "Tahun" on that form, "Minggu Ke" should be shown data automatically from database. but as you can see on the picture, it's just loading ( on form ) – Ojay.123 Oct 18 '20 at 04:05
  • 1
    OK, so first thing you need to check is the network traffic of the browser, did JavaScript fire that Ajax request after changing `Tahun`or not ? if no debug the JavaScript code and see why it didn't made that request, if yes then check what is the response from the server, is it as you expect ?. **you know how to inspect the network traffic(requests) in your browser, right ?** – Accountant م Oct 18 '20 at 06:08
  • when I choose/change "Tahun" to 2019 or 2020 on form, there is messege on inspect "/jakarta/modules/presensi2/tambahShift.php?tb=thn&thn=2019:1 Failed to load resource: the server responded with a status of 500 ()" what should I do then? – Ojay.123 Oct 18 '20 at 07:12
  • 500 us a generic error message shown to the browser when the server side code has crashed. It (deliberately) doesn't give away too much detail. To find the underlying error message you should look in the PHP error log file on the server – ADyson Oct 18 '20 at 08:17
  • 1
    @ADyson the logs show "...Uncaught exception 'Exception' with message 'DateTime::__construct(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /var/www/vhosts/myweb/public_html/presensi2/tambahShift.php:22, referer: https://myweb//presensi2/tambahShift.php" – Ojay.123 Oct 18 '20 at 08:41
  • I have already change the date.timezone – Ojay.123 Oct 18 '20 at 08:42

0 Answers0