nginx? PHP ???? ?? ???? ????? ???? ??(??? ??)
Jun 09, 2022 am 09:54 AM? ???? nginx???? ?? ???? ????? ???? ??? ?? ???? ??? ?? ?? ??? ?? ??? ?? ?? ???????. ?? ???? ??? ??? ????.
(?? ????:
, PHP ??? ????) nginx ?? ???
location ~ /image/.*\.(gif|jpg|jpeg|png)$ { proxy_pass http://127.0.0.1:8888/test/watermark?url=$request_uri; }
/img/
???? ???? ??? ??, $ request_uri
????? ???? ??? ?????.
php ???? ???/img/
匹配要代理的目錄前綴,$request_uri
參數(shù)為訪問的圖片路徑。
php 水印類
/** 水印類 * Class Watermark * @package app\test */ class Watermark { /** 合成圖片水印 * @param string $dstImage 原圖片 * @param string $waterImg 水印圖 */ public static function imageMarking($dstImage, $waterImg){ //獲取圖片信息 $dstInfo = getimagesize($dstImage); $waterInfo = getimagesize($waterImg); //創(chuàng)建圖像 $dstImgObj = self::imageCreateFrom($dstImage, $dstInfo[2]); $waterImgObj = self::imageCreateFrom($waterImg, $waterInfo[2]); //合成水印 imagecopyresized($dstImgObj,$waterImgObj,0, 0,0,0,$dstInfo[0], $dstInfo[1],$waterInfo[0],$waterInfo[1]); //輸出圖片 self::imageOut($dstImgObj,$waterInfo[2]); //銷毀資源對象 imagedestroy($dstImgObj); imagedestroy($waterImgObj); } /** 生成圖片對象 * @param string $imgFile 圖片路徑 * @param string $type 圖片類型 * @return false|\GdImage|resource */ private static function imageCreateFrom($imgFile, $type) { switch ($type) { case IMAGETYPE_GIF: return imagecreatefromgif($imgFile); case IMAGETYPE_JPEG: return imagecreatefromjpeg($imgFile); case IMAGETYPE_PNG: return imagecreatefrompng($imgFile); default : //其他格式 } } /** 輸出圖片 * @param string $imageObj * @param string $type */ private static function imageOut($imageObj,$type){ switch ($type) { case 1: header("Content-Type: image/gif"); imagegif($imageObj); break; case 2: header("Content-Type: image/jpeg"); imagejpeg($imageObj); break; case 3: header("Content-Type: image/png"); imagepng($imageObj); break; default: //其他格式 } } }
調(diào)用示例
public function watermark(){ //圖片路徑前綴 $image = '/data/img/' . input('url'); self::imageMarking($image,'watermark.png'); exit; }
nginx
水平好的,可以試著用 http_image_filter_module
rrreee
rrreeenginx
????? http_image_filter_module
??? ??? ????? ??? ? ?? ????. ???? ??? ???( ?? ????: nginx ????
? ??? nginx? PHP ???? ?? ???? ????? ???? ??(??? ??)? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ?? ??? ??? ?? JavaScript? MediareCorder API? ?? PHP ???? ???? ?????. 2. PHP? ???? ?? ??? ???? STTAPI (? : Google ?? Baidu ?? ??)? ???? ???? ?????. 3. PHP? ???? AI ??? (? : OpenAigpt)? ????. 4. ?? ?? PHP? TTSAPI (? : Baidu ?? Google ?? ??)? ???? ??? ?? ??? ?????. 5. PHP? ?? ??? ??? ??? ??? ?? ?? ??? ?????. ?? ????? PHP? ?? ???? ?? ?? ?? ??? ??? ?????.

PHP?? ?? ?? ??? ???? ?? ??? ? ???? ?? ??? ???? ?? ??? ???? ???? ????. 1. ?? ?? ??? ?? ??? URL ? ?? ??? ????. 2. UrlenCode? ???? ?? ??? ???????. 3. ? ???? ????? ?? ?? ??? ? ?? ??? ?????. 4. ???? ???? ?? ? ? ??? ??? ??? ??? ?????. 5. ??? ?? ??? ????? ?? ????? OG ??? ???? ?????. 6. XSS ??? ???? ?? ??? ??? ?????. ? ???? ??? ??? ???? ??? ?? ?? ??? ??? ???? ??? ?? ??? ?????.

AI? ??? ??? ?? ?? ? ?? ???? ????? ?? ??? ??????. 1. Baidu, Tencent API ?? ?? ?? NLP ?????? ?? ??? AI ?? ?? API? ??????. 2. PHP? ? ?? guzzle? ?? API? ???? ?? ??? ??????. 3. ?? ????? ?? ?? ??? ???? ???? ???? ??? ??? ? ????. 4. ?? ?? ? ?? ???? ?? PHP-L ? PHP_CODESNIFFER? ??????. 5. ???? ????? ???? ?? ?? ??? ?????? ??? ??????. AIAPI? ??? ? ???, ?? ??, ?? ? PHP ?? ??? ??? ???. ?? ???? PSR ??? ???, ??? ????? ????, ?? ??? ???, ????? ??? ????, X? ???????.

1. ?? ???? ??? ??? ?????? ?? ?? ??? ??, ??? ?? ???? ??? (? : ?? ???, ? ? ??), ?? ??? ?? ???? ???? ? ?? ?? ??? ??? ?? ??? ????????. 2. ?? ??? ??? ?? ? ??? ???? ?? ?? ?? ???? ?? ? ?? AUDIT ?? ??? ??? ? ????? ????? ??? ???????. 3. ?? ?? ??? ?? ??? ???????. Recaptchav3 ???? ??, ??? ?? ?? ?? ?? ??, IP ? ?? ??? ??? ??? ?? ???? ??? ?? ??? ????? ??? ???? ????? ??? ?????.

PHP? AI ??? ??? ?? ????? ??? API? ?? ?????. ??? ??? ????? ? ??? ???? ?????. API ??? ?? ?? ??? ???? ??? ??? ???? ???? ? ????. 2. ?? ?? ???? guzzle ?? curl? ???? HTTP ??? ???, JSON ??? ??? ? ???, API ? ?? ??, ??? ? ?? ??? ???? ??, ??? ?? ?? ? ? ?? ????, ??? ?? ? ?????? ?????. 3. ???? ???? ?? ???? API ??, ?? ? ??? ?? ??, ??? ?? ??, ?? ?? ? ??? ??? ??? ?????. ?? ??? ??? ??? ? ??? ???? Propt ?? ? ?? ?? ??, ??? ?? ? ?? ????, ?? ?? ?? ???? ? ??? ?? ? ???? ????? ?????.

PHP? ?????? ????? ?? ?? ?? ???? ???? ?? ???? ???? ?? ?? ???? ?????. 2. ?? ??? ???? ???? ?? ??? ?? ? ??? ??? ???? ?? API/Webhook ??? ??? ?? ???? ??? ??? ??? ??? ?????. 3. ?? ????? ?? ??, ??/???? ????, ???? ??, ???? ? ??? ?????? ????? ?? ??? ???? ???? ?? Dingtalk, SMS ?? ??? ???? ??? ?????? ???? ?? ? ??? ??? ????? ?? ??? ???? ???????.

PhpisstillRelevantinmodernenterpriseenvironments.1. Modernphp (7.xand8.x)? ??? ??, ??? ??, jitcompilation ? modernsyntax, mateitsuilableforlarge-scalepplications

??? AI ?? ?? ???? ???? PHPSDK? ??????. 2. PHP? ???? FFMPEG? ???? ???? API ?? ?? (? : WAV)?? ?????. 3. ??? ???? ????? ????? API ???? ??? ??????. 4. NLP ??? ???? JSON ??? ???? ???? ?????. 5. ?? ??? ???? ???? ?? ?? ?? ?? ?? ??? ?????. ?? ????? ?? ?? ? ??? ???? ?? ??? ???, ??? ?? ? ??? ???????.
