0

我在服务器上的 Cakephp 1.3 项目中导入供应商类时遇到问题。

我刚刚从 Ubuntu 12.04 LTS 服务器升级到 Ubuntu 14.04,我遇到了这个问题:我的供应商类没有正确导入,导致我的整个项目崩溃。

我的错误如下所示:

xmlDocument = file_get_contents($url); $this->parseXMLDocument(); } /** * parseXMLDocument method * * @access public * @return void */ function parseXMLDocument() { try { $xml = new SimpleXMLElement($this->xmlDocument); $this->date=$xml->Header->PublishingDate; foreach($xml->Body->Cube->Rate as $line) $this->currency[]=array("name"=>$line["currency"], "value"=>$line, "multiplier"=>$line["multiplier"]); } catch(Exception $e) { pr($e); } } /** * getCurs method * * get current exchange rate: example getCurs("USD") * * @access public * @return double */ function getCurs($currency) { foreach($this->currency as $line) if($line["name"]==$currency) return $line["value"]; return "Incorrect currency!"; } function getValue($currency) { foreach($this->currency as $line) if($line["name"]==$currency) return (String)$line["value"]; return "Incorrect currency!"; } } 

Fatal error: Class 'cursBnrXML' not found in /var/www/html/amsrentacar/app/app_controller.php on line 875

致命错误上方的代码实际上是应该使用以下方法导入的类的内容:

App::import('Vendor', 'bnr');
$currency = new cursBnrXML("http://www.bnr.ro/nbrfxrates.xml");

这段代码仍然可以在我的本地 Ubuntu 14.04 LAMPP 驱动的桌面上运行,但不能在服务器上运行,我不明白为什么。

这里有人有什么想法吗?

我真的需要尽快让这个工作。

4

0 回答 0