【问题标题】:Your application folder path does not appear to be set correctly error in codeigniter您的应用程序文件夹路径似乎没有在 codeigniter 中正确设置错误
【发布时间】:2016-07-14 16:32:03
【问题描述】:

我收到一个名为“您的应用程序文件夹路径似乎设置不正确。请打开以下文件并更正: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>

【问题讨论】:

  • 你在使用 xampp 吗?沼泽?等
  • 当您说I use the site within a folder in main domain 时,您的意思是像一个子域吗?
  • 是的,它就像子域。但它实际上不是子域。这是一个普通文件夹。

标签: php .htaccess codeigniter


【解决方案1】:

您还应该发布您的“配置”文件,通常这来自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 = '';

你可以试试这个:

$system_path = './system';

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

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

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

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

【讨论】:

    【解决方案2】:

    您会注意到在 codeIgniter 中有一个“系统”目录。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-08
      • 1970-01-01
      • 2019-07-02
      • 2018-04-17
      • 2017-03-15
      • 2018-09-12
      • 2016-09-14
      相关资源
      最近更新 更多