您的应用程序文件夹路径似乎没有在codeigniter中正确设置错误

时间:2016-03-27 07:40:45

标签: php .htaccess 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>

2 个答案:

答案 0 :(得分:1)

你也应该发布你的配置&#39;文件,通常是来自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文件进行检查。

从此处开始:Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.phpCodeIgniter CLI giving system_path error "path does not appear to be set correctly."

  

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

     

$ system_path =&#39;&#39;;

     

你可以试试这个:

     

$ system_path =&#39; ./ system&#39;;

有些人也通过设置CI文件夹的权限来解决这个问题:

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

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

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

希望它有所帮助!

答案 1 :(得分:0)

您会在codeIgniter中注意到有一个&#39;系统&#39;目录。

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

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