다음과 같이 업무 일 계산에 일요일을 설명하는 기능이 있습니다. 그것은 Mac에서 실행되는 MAMP 인 테스트 서버에서 작동합니다. LAMP를 실행하는 Unbuntu 서버로 코드를 옮기면 작동을 멈 춥니 다 (아무 것도로드하지 않는 페이지로 나타남).MAMP와 Ubuntu Server의 구문 차이
나는 이유를 알아낼 수 없으며, 작은 따옴표와 큰 따옴표의 다양한 조합을 시도했다.
기능은 다음과 같습니다 -이 될 수있는 이유에 잃었어요
// function to account for Sundays, and public holidays. Add holiday dates in $holidayDays variable
function get_next_business_date($from, $days) {
$workingDays = [1, 2, 3, 4, 5, 6]; # date format = N (1 = Monday, ...)
$holidayDays = ["*-12-25","*-12-26", "*-01-01", "2014-12-24"]; # variable and fixed holidays
$from = new DateTime($from);
while ($days) {
$from->modify("+1 day");
if (!in_array($from->format('N'), $workingDays)) continue;
if (in_array($from->format('Y-m-d'), $holidayDays)) continue;
if (in_array($from->format('*-m-d'), $holidayDays)) continue;
$days--;
}
return $from->format("Y-m-d"); # or just return DateTime object
}
$today = date("Y-m-d", strtotime("today"));
$tomorrow = get_next_business_date("today", 1);
$twodays = get_next_business_date("today", 2);
$yesterday = date("Y-m-d", strtotime("yesterday"));
.
PHP에서 "아무것도로드하지 않는 페이지"또는 "죽음의 흰색 화면"은 오류 로그를 확인해야한다는 것을 의미합니다. 항상 코드를 개발하고 테스트 할 때'error_reporting (E_ALL); 스크립트의 맨 위에있는 ini_set ('display_errors', 1); 오류가 자세히 설명됩니다. –
이 기능과 관련이 있습니까? 아마도 권한 문제일까요? – Fluffeh
review /var/log/apache2/error.log –