您的应用程序文件夹路径似乎设置不正确,代码点火器中出现错误


Your application folder path does not appear to be set correctly error in codeigniter

我收到一个错误,名为"您的应用程序文件夹路径似乎设置不正确。请打开以下文件并更正此错误:index.php"。我在主域的文件夹中使用该网站。如果需要的话,我的.htaccess文件如下。

<IfModule mod_rewrite.c>
############################################
## enable rewrites
# For security reasons, Option followsymlinks cannot be overridden.
#    Options +FollowSymLinks
    Options +SymLinksIfOwnerMatch
    RewriteEngine on
############################################
## you can put here your magento root folder
## path relative to web root

############################################
## workaround for HTTP authorization
## in CGI environment
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## always send 404 on missing files in these folders
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and links
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
    RewriteRule .* index.php [L]
</IfModule>
<IfModule mod_security.c>
    # Turn off mod_security filtering.  SMF is a big boy, it does not need its hands held.
    SecFilterEngine Off
    # The below probably isn't needed, but better safe than sorry.
    SecFilterScanPOST Off
</IfModule>

您还应该发布您的"config"文件,通常它来自base_url或其他混乱的文件。我的CI工作网站使用:

$config['base_url']         = 'http://yourUrl.com/';
$config['index_page']           = '';
$config['uri_protocol']     = 'REQUEST_URI';
$config['url_suffix']           = '';

.htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #Add www.
    RewriteCond %{HTTP_HOST} ^www.yourUrl.com [NC]
    RewriteRule ^(.*)$ http://.yourUrl.com/$1 [L,R=301]
    RewriteCond %{REQUEST_URI} ^core.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

一切都很好。您可以使用自己的config/htaccess文件进行检查。

从这里开始:您的系统文件夹路径似乎设置不正确。请打开以下文件并更正:index.php和CodeIgniter CLI给出system_path错误";路径似乎设置不正确"

解决方案是将$system_path留空。。。

$system_path=";

你可以试试这个:

$system_path='/系统;

一些人还通过设置CI文件夹的权限解决了这个问题:

  1. 将项目文件夹权限设置为755。例如,sudo chmod 755/var/www/myCI项目/

最后,对于共享服务器/文件夹:

https://serverfault.com/questions/371739/putting-folders-above-public-html-in-a-shared-hosting-environment

您会注意到在codeIgniter中有一个"system"目录。

导航到您的index.php文件,转到$system_path并将其设置为该路径。

今天,当我将索引文件从codeIgniter目录移到根目录时,我注意到了这一点。您还会发现,它将跟踪应用程序目录。我在同一位置找到了我的目录(codeIgniter根目录)。一旦我更换了路径,它就运行良好。