codeigniter project when uploaded to server gives me the following error.
Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php
it is working well locally & on 000webhost.com hosting.
When uploaded to private server of parallels it gives the above error.
My index.php is as follows.
<?php
define('ENVIRONMENT', 'development');
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
$system_path = 'system';
$application_folder = 'application';
if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}
if (realpath($system_path) !== FALSE)
{
$system_path = realpath($system_path).'/';
}
$system_path = rtrim($system_path, '/').'/';
if ( ! is_dir($system_path))
{
exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
}
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('EXT', '.php');
// Path to the system folder
define('BASEPATH', str_replace("\\", "/", $system_path));
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
// The path to the "application" folder
if (is_dir($application_folder))
{
define('APPPATH', $application_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('APPPATH', BASEPATH.$application_folder.'/');
}
require_once BASEPATH.'core/CodeIgniter.php';
In my case, I didn't go to mess with .htaccess, actually before going to do that, as it's suggested in the above post, I tried its later part, which is changing the
To the following
And it simply worked for me!
~~~~~~~~~~~~~~~~~~ Edit to add some more information ~~~~~~~~~~~~~~~~~~~~~
My CodeIgniter Directory structure:
And my .htaccess file contains the following:
My
index.php
file is the same one provided by CodeIgniter root folder, but I have to change two lines in it as I place it inside the public_html directory instead of it's original place:Note: look for the following two lines within the
index.php
,-
$system_path
-
$application_folder
They have been edited, to point the locations, where
system
directory andapplication
directory reside in.Hope this might help somebody out there!
CodeIgniter Rocks!
I have same issue then i create controller inside that i have created index method then call cron file with below command it is working for me.
this solution work for me.
I've never in 40+ years of doing this seen a product delivery as bad as this one. And the internet searches to resolve configuration/design issues just makes the solution effort even worse.
Trying to get this product to work has been a absolute nightmare. This makes Spring Boot look like the greatest improvement in product delivery ever!!
If you want to force some into SaaS this is the way to get it done.
try this .htaccess on root folder
assumming that index.php is your index page.
and change in config.php
If You uploading Your project follow these steps
Make sure You have upload application, system, index.php, .htaccess
Modify your
config/database.php
with your hosted database.Make sure URL spellings, Cz LINUX Hosting is Case-Sensitive.
Make sure all resources are uploaded to server. (CSS, JS, Images, etc ...)
Hopes this helps You :)