Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 3 through composer?
#1

I just installed CodeIgniter 3 through composer by kenjis.

after installing I noticed the root folder is exposed.
and there are these /public/ and /vendor/ sub-folder.
So how do I make the root folder run the index.php?

sorry I'm confused with this new settings.

Or can someone please explain to me in simple english the purpose of /public/

thanks in advance.
Reply
#2

In the index.php you can set the paths to these folders application, system and views.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Also make sure your Apache web accessible folder points at the /public/ folder.
Everything else is stored below this folder for security.
This is considered a PHP best practice.
Reply
#4

@dmyers
How to point apache web accessible folder point to /public/ folder?
can you teach me please.

thanks in advance.
Reply
#5

I also noticed there is /bin/ folder.
So what is the purpose of the bin folder?

Also, there are two /application/ folder
The first one is in the root folder /application/
The 2nd one is in the /vendor/codeigniter/framework/application/

So which /application/ folder should I put my MVC files etc... ?
Reply
#6

(This post was last modified: 05-27-2016, 09:44 AM by iridion2015.)

And when I typed in the search bar url /localhost/ci3/vendor/ the files are also exposed.
So how to make this folder secure also?

sorry guys noob here.
thanks in advance.
Reply
#7

Thats quite a bit to cover. In brief:

Quote:Or can someone please explain to me in simple english the purpose of /public/
These are the files that a HTTP request can access.
So www.mydomain.com/testing/test.html would go to /public/testing folder and look for the file test.html

Quote:How to point apache web accessible folder point to /public/ folder?
I don't think you need to do this on local host. When you host your site your hosting provider will tell you it's preferred folder for public files and set up the system to access only this folder publicly by default. It is usually '/public/' but does not have to be.

Quote:So which /application/ folder should I put my MVC files etc... ?
In your initial insatall, you will see the welcome page. That tells you where to find the controller for the welcome page and the view for it too. These are the folders to use. Later, when you are more familiar with CI you can set these to be anywhere you choose in the config file, but I would advise leaving that for now as it is.

Quote:And when I typed in the search bar url /localhost/ci3/vendor/ the files are also exposed.
Again, you do not have to worry about that on localhost. It is only when you are hosting your site for real that these things are relevant.

You also asked about the BIN folder, it is short for BINARY and executables are stored in there. You will almost certainly not need this.

Hope that helps,

Paul.
Reply
#8

If you are running Apache you want to look in your /etc/apache2/apache.conf file for something that looks like <Directory /var/www/> usually (depending on what else is configured) changing it to <Directory /var/www/public/> would do the trick. I normally add a extra folder for the git clone directory thou. Something along the lines of /var/www/app/public That way I can cd into /var/www and git clone to app
Reply
#9

Okay thanks guys.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB