CodeIgniter incorrect system path on private server

后端 未结 5 543
半阙折子戏
半阙折子戏 2021-01-06 01:27

codeigniter project when uploaded to server gives me the following error.

Your system folder path does not appear to be set correctly. Please open t

5条回答
  •  忘掉有多难
    2021-01-06 02:02

    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

    $config['index_page'] = 'index.php';
    

    To the following

    $config['index_page'] = '';
    

    And it simply worked for me!

    ~~~~~~~~~~~~~~~~~~ Edit to add some more information ~~~~~~~~~~~~~~~~~~~~~

    My CodeIgniter Directory structure:

    htdocs /
           |_ CI /
                 |_ OnlineStoreApp /
                                   |_ online_store_ci  // This is the CodeIgniter folder
                                   |_ public_html /
                                                  |_ css
                                                  |_ js
                                                  |_ fonts
                                                  |_ .htaccess // see bellow for more details
                                                  |_ index.php // see bellow for more details
    

    And my .htaccess file contains the following:

    DirectoryIndex index.php
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]
    

    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 and application directory reside in.

    Hope this might help somebody out there!

    CodeIgniter Rocks!

提交回复
热议问题