开发者

Problem requiring resource PHP Codeigniter

开发者 https://www.devze.com 2022-12-13 21:33 出处:网络
So I had an issue last night when I went to upload a project I\'ve been working on loca开发者_开发技巧lly to my server.

So I had an issue last night when I went to upload a project I've been working on loca开发者_开发技巧lly to my server.

I had this:

require_once "/../controllers/source/MySpaceID/myspace.php";

Which is the correct path to that file finding its way out of the libraries folder. It worked fine until I put it on the server. Any thoughts?


Echo you current working directory on the server ( echo getcwd(); ) and check your path from there, that's probably where your problem lies.

It sounds strange to me that CI would use ./library as its working directory - unless you set it yourself.

Note that you should use code igniter's APPPATH constant to create absolute paths instead of using relative ones, this will make things easier for you on the long term.


Lepidosteus is correct. Your library should live in /application/library/ and you should require it like this require_once APPPATH.'/libraries/MySpaceID/myspace.php'

0

精彩评论

暂无评论...
验证码 换一张
取 消