Hello,

I am trying to understand the CI code that somebody made. I saw there are two folders: site & admin folders in CI application folder.

I wonder why? Is it to separate the site and admin page? Is that possible?

Recommended Answers

All 6 Replies

Member Avatar for LastMitch

I am trying to understand the CI code that somebody made. I saw there are two folders: site & admin folders in CI application folder.

If someone created those 2 folders, then you should ask that person who create it.

I'm not being rude but you been posting these ridiculous questions about CI when you can look at their guides & forum.

There are tutorial on CI but you seen want to get a quick answer/code on Daniweb and not bother learning and understanding how the CI platform function.

Well, I have been reading the CI guides. The CI tutorials from google also a good idea.

I have asked the person regarding the the two files in the application, he mentioned that yes that's to seperate the backend and the frontend. I am trying to create a similar thing. It's not a good idea though if I keep asking too much about the programming side of CI.

So I thought I am looking for another source to answer the question maybe someone else can help me.

I receive this errors when I run the CI program after seperating the site and admin in application folders:

Warning: require(application/config/constants.php): failed to open stream: No such file or directory in C:\xampp\htdocs\IndonusaCI\system\core\CodeIgniter.php on line 64

Fatal error: require(): Failed opening required 'application/config/constants.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\IndonusaCI\system\core\CodeIgniter.php on line 64

Anyone know how to fix this problem?

Thanks before.

I dont really dabble to much in CI, however what you have is a broken require link. Basically in CodeIgniter.php on line 64 you should have a

require ('applications/config/constants.php'); 

line of code. You need to double check your file path because for whatever odd reason the script is not able to find that file in that directory. If you have been moving around files like you mentioned above it may just be that the file is not sitting in the proper directory. I would open up google and look up how to properly require/include files in your scripts, using variables, absolute and relative paths.

This is on line 64:

    else
    {
        require(APPPATH.'site/config/constants.php'); 
        require(APPPATH.'config/constants.php');
    }

I thought it already in the correct address, yet it still showing me the same error.

line 64 (require(APPPATH.'site/config/constants.php');) appears to works:

why now line 65 (require(APPPATH.'config/constants.php');) showing similar error?

Warning: require(application/config/constants.php): failed to open stream: No such file or directory in C:\xampp\htdocs\IndonusaCI2\system\core\CodeIgniter.php on line 65

Fatal error: require(): Failed opening required 'application/config/constants.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\IndonusaCI2\system\core\CodeIgniter.php on line 65

It is custom made file system, not CI native.
You need to be sure if site folder is still there (in application).
Also, if in application folder, as you say, there are just two folders site and admin, second require is not acceptable. Simply, there is no config file directly under APPPATH. Try with:

require(APPPATH.'admin/config/constants.php');

If you're going to change the folder names for the application and system folders you need to go into the main CI index.php file and change those values to your new file names.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.