 |
|
ทำการสร้างไฟล์ php ใน appserver น่ะครับ มีโค๊ดดังนี้น่ะครับ
Code (PHP)
<?php
$url = 'https://api.parse.com/1/push';
$appId = '6f3TkrVj8wIjzHMqrXhvUQxbAqiOQkSnmuLIUTdZ';
$restKey = '4meNoJAw9tV5F695W2Jz7qh2b53QquVPuFVE9m5n';
$push_payload = json_encode(array(
"where" => array(
"deviceToken" => 'APA91bFCIAxhtHle3mxcqNYx53YiUB2-
qA18OkdX5QYxlpUwbefrxpoo589NYfmgMF5Jd2xR3u6Hx4_a6gGaZIQFSlziRfk1yA-l3DfMf_XbCH8tzo-Xhw_HfXCOE6cmQ49Y0Tk4EDJEoqUtPK7OOGWfF-
7OEdmfRpHyIj_3_6eDaIp2bclGuU4',
),
"data" => array(
"alert" => 'test'
)
));
print_r($push_payload);
$rest = curl_init();
curl_setopt($rest,CURLOPT_URL,$url);
curl_setopt($rest,CURLOPT_PORT,1080);
curl_setopt($rest,CURLOPT_POST,1);
curl_setopt($rest,CURLOPT_POSTFIELDS,$push_payload);
curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($rest,CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($rest,CURLOPT_HTTPHEADER,
array("X-Parse-Application-Id: " . $appId,
"X-Parse-REST-API-Key: " . $restKey,
"Content-Type: application/json"));
$response = curl_exec($rest);
$arr['StatusID'] = $response;
$arr['Error'] = "";
echo json_encode($arr);
?>
แต่เมื่อเรียกใช้งานแล้ว ใช้งานแล้ว ปรากฏ Fatal error: Maximum execution time of 30 seconds exceeded in C:\AppServ\www\app\parse.php on line 31 ประมาณว่า หมดเวลาการเชื่อมต่อ อยากทราบว่าเกิดจากปัญหาอะไรหรอครับ ช่วยแนะนำหน่อย
Tag : PHP
|
|
 |
 |
 |
 |
Date :
2014-10-29 13:48:43 |
By :
jompol0102 |
View :
910 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |