-7
我想創建我的圖像編輯器網站,但我面臨着很多製作此網站的問題。問題是,當我將它上傳到我的網站託管網站時,它說的是語法錯誤。爲什麼我的圖像編輯器腳本說的語法錯誤
<?
include_once('ImageEditor.php');
$src = new ImageEditor();
$dst = new ImageEditor();
$dst->createCanvas(200, 400);
$src->loadImageFile('nalin.jpg');
$dst->fillin($src, 0, 1000);
$drop = new ImageEditor();
$drop->loadImageFile('1.jpg');
#$dst->dropin($drop, 20 ,50);
$dst->fillinArea($drop, 10, 20, 100, 100);
$dst->fillinArea($drop, 10, 350, 100, 100);
#$src->rotate(90);
#$dst->fitin($src);
#$dst->applyGrayscale();
#$dst->pseudosepia(20);
#$dst->sepia(60);
#$dst->grayscale();
$dst->writeImageFile('out.jpg', ImageEditor::JPG, 75);
#$src->writeImageFile('out.jpg', ImageEditor::JPG, 75);
#$dst->displayImage('JPG');
?>
而我ImageEditor.php是從GitHub採取你輕鬆[查看這裏] [1]。
我面對一個錯誤,當我把它上傳到我的虛擬主機的網站:
Fatal error: Class 'ImageEditor' not found in /home/a2226731/public_html/image.php on line 3
[請不要發佈您的代碼/異常爲圖像。(// meta.stackoverflow.com/q/285551/3933332) – FrankerZ
確定ImageEditor.php存在?檢查CaPiToLiZaTiOn,它對Linux機器(但不是Windows機器)很重要。 – FrankerZ
哦,來吧 - PHP甚至**告訴**你錯誤是什麼*類'ImageEditor'沒有找到... *,即你的'include_once'路徑是錯誤的;在技術說明中,因爲該類是**必需的**所以您應該使用* require_once *。 – CD001