简体   繁体   中英

Why does my app fail to find and use a file on two LINUX OS machines when knowing the URL?

I have a Yii MVC App. When running the app under Windows OS, the app locates and uses the needed file.

I now have 2 OS's, Linux OS's and, on one, my app finds and uses the file, and on another, it fails.

$this->font1 = Yii::app()->baseUrl . '/protected/extensions/TextFigletCaptcha/flf/' . $this->font1 . '.flf';
if (!file_exists($this->font1)) {
throw new Exception('Font file not found!<br/>');
}

What's happening ?

我找到了我的问题的答案:

$this->font1 = Yii::app()->getBasePath(true) . '/extensions/TextFigletCaptcha/flf/' . $this->font1 . '.flf';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM