How do I get the project basepath in CodeIgniter

Alok Das picture Alok Das · Jun 19, 2013 · Viewed 155.8k times · Source

I have created a folder as user in the root directory.

My project base path is:

/var/www/myproject/

When I want to access the base path as BASEPATH from a controller it's showing:

/var/www/myproject/system/ 

But I want the path to be:

/var/www/myproject/ 

I am new to CodeIgniter. How do I set this path?

Answer

Amar Banerjee picture Amar Banerjee · Jun 19, 2013

Use FCPATH instead of BASEPATH for more check this link.

Codeigniter - dynamically getting relative/absolute path outside of application folder