問題描述
在我的服務器上拋出以下異常:
致命錯誤:在...中找不到My_Model_Bo_User_Agenda_Doctors"類
盡管在 localhost 中一切正常.
The following exception is thrown on my server:
Fatal error: Class 'My_Model_Bo_User_Agenda_Doctors' not found in...
Though in localhost everything is working fine.
我檢查了所有內容是否正確上傳;所有文件都存在并且沒有損壞.我也嘗試上傳幾次.所以這似乎不是問題.
I checked that everything was correctly uploaded; all the files are present and not corrupted. I also tried to upload several times. So this doesn't seem to be the problem.
知道為什么在服務器上找不到類嗎?
Any idea why a class couldn't be found on the server ?
推薦答案
您在問題中沒有這么說,但我懷疑您是在 Windows 上開發并在 Linux 上托管.
You don't say so in your question, but I suspect that you are developing on windows and hosting on Linux.
Windows 對路徑名不區分大小寫,但 Linux 是!檢查:-
Windows is not case sensitive to path names, but Linux is! Check that:-
- Doctors.php 不是doctors.php
- Agenda/是不是議程/.etc
- 最后檢查類聲明中的類名是否正確且大小寫正確.
- Doctors.php is not doctors.php
- Agenda/ is not agenda/ .etc
- Lastly check the class name in the class declaration is correct and correctly cased.
不要只是自己想,是的,我已經這樣做了,請仔細檢查它們.相信我,慘痛的經歷告訴我,這個問題總是因為這樣一個微不足道的疏忽造成的.
Do not just think to yourself, yes I've done that, go and check them carefully. Believe me, bitter experience has taught me this problem is always due to a trivial oversight like this.
這篇關于Zend 框架:找不到模型類的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!