Googleカレンダーを使って予約する
システムを作っています。
以下のエラーが出てしまいます。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at info@coreserver.jp to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
yoyaku.cgiの内容
#!/usr/local/bin/php
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>予約テスト</title> </head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><body> <h1>予約システム</h1> <form action="" method="POST"> <a href ="syosin.php ">初診の方はこちら<a> <a>"初診でない方は下へどうぞ"</a> <form action="" method="POST"> <?php define('CALENDAR_ID', '83759546687-i9kah6kq5nab7mk5ff7fdaqv4rtefi6e.apps.googleusercontent.com '); define('API_KEY', 'AIzaSyDAm529S-rygCdUi-dtIsawQABxRKQf8Y8'); define('API_URL', 'https://www.googleapis.com/calendar/v3/calendars/'.CALENDAR_ID.'/events?key='.API_KEY.'&singleEvents=true'); // ここでデータを取得する範囲を決めています $t = mktime(0, 0, 0, 1, 1, 2018); $t2 = mktime(0, 0, 0, 12, 31, 2018); date_default_timezone_set('Japan/Tokyo'); $script_tz = date_default_timezone_get(); if (strcmp($script_tz, ini_get('date.timezone'))){ echo 'Script timezone differs from ini-set timezone.'; } else { echo 'Script timezone and ini-set timezone match.'; } $params = array(); $params[] = 'orderBy=startTime'; $params[] = 'maxResults=10'; $params[] = 'timeMin='.urlencode(date('c', $t)); $params[] = 'timeMax='.urlencode(date('c', $t2)); $url = API_URL.'&'.implode('&', $params); //ファイルロック //$fp = fopen('file.txt', 'mode'); //if (flock($fp, LOCK_EX)){ $results = file_get_contents($url); $json = json_decode($results, true); var_dump($json);
.htaccessの内容
AddHandler application/x-httpd-php52cgi.php
AddHandler application/x-httpd-php53cgi.php
AddHandler application/x-httpd-php54cgi.php
AddHandler application/x-httpd-php6cgi.php
php.ini
isplay_errors = Off
mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
;mbstring.http_output = UTF-8
mbstring.detect_order = auto
実行するときは.
yosaku.cgi
で投稿するようにしています。
当方の方で調べてやり尽くしたのですが
なんだかバージョンがあっていないのか
よくわかりません。





回答1件
あなたの回答
tips
プレビュー