Code
PHP 寫 LINE BOT 起手,複製貼上換一換就好
<?php
$access_token ='從 LINE 那邊取得的';
//define('TOKEN', '你的Channel Access Token');
//richmenu token
$richm = "這也是從 LINE 那邊取得的";
$json_string = file_get_contents('php://input');
//$file = fopen("LineLog.txt", "a+");
//fwrite($file, $json_string."\n");
$json_obj = json_decode($json_string);
$event = $json_obj->{"events"}[0];
$type = $event->{"message"}->{"type"};
$userid = $event->{"source"}->{"userId"};
$message = $event->{"message"};
$reply_token = $event->{"replyToken"};
$msgtext = $message->{"text"};
$postbackdata = $event->{"postback"}->{"data"};
$timestamp = $event->{"timestamp"};
$originalContentUrl = $message->{"contentProvider"}->{"originalContentUrl"}; //抓掃描回來的圖片後面所帶的資訊
$ss = $json_string;
session_start();
//$_SESSION['line_userid'] = $userid;
?>
IIS + PHP + ffmpeg-php + FFmpeg
假設已經安裝完 Windose server IIS + PHP 7
以下套件 :
到這裡下載 FFmpeg 三個檔案 https://www.gyan.dev/ffmpeg/builds/
到系統控制台設定 ffmpeg 的 PATH 環境變數
https://web.archive.org/web/20200918193221/https://ffmpeg.zeranoe.com/builds/win64/shared/
下載安裝 Composer 然後用 CMD 跑一次 composer require php-ffmpeg/php-ffmpeg
Composer 跑完後找到 vender 資料夾,複製到 IIS 的 WEB 資料夾中
設定 FFmpeg 三個 exe 所在的 bin 資料夾權限 ( 及其父資料夾權限 )