在IIS 7上部署CodeIgniter 1.7.2应用程序

问题描述 投票:1回答:1

我在wamp上开发了一个Codeigniter 1.7.2,它几乎完成了。现在我试图在IIS 7上托管它(因为提供给我的控制面板只有IIS)我收到错误。这就是我得到的:

Warning: require(system/codeigniter/Common.php) [function.require]: failed to open stream: No such file or directory in c:\abc\wwwroot\system\codeigniter\CodeIgniter.php on line 38

Warning: require(system/codeigniter/Common.php) [function.require]: failed to open stream: No such file or directory in c:\abc\wwwroot\system\codeigniter\CodeIgniter.php on line 38

Fatal error: require() [function.require]: Failed opening required 'system/codeigniter/Common.php' (include_path='C:\Program Files (x86)\PHP\pear;./;./includes;./pear') in c:\abc\wwwroot\system\codeigniter\CodeIgniter.php on line 38

我完全不知道它给出了什么错误,我该怎么做才能解决它。

我已经在网上搜索过,发现它有一些htaccess问题。这是我的htaccess文件:

Options +FollowSymLinks
IndexIgnore */*

<ifmodule mod_rewrite.c>
RewriteEngine on

    # if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # otherwise forward it to index.php
    RewriteRule ^(.*)$ index.php/$1 [L]

</ifmodule>

我不知道如何转换它以及在web.config中写什么。我正在使用websitepanel来部署网站。

php codeigniter iis-7
1个回答
2
投票

也许这就是它?您应该在webroot的index.php中找到以下代码。问题是,您是否指定了完整的服务器路径?确保您使用完整的服务器路径,而不仅仅是来自webroot,或者使用index.php文件中* $ system_folder *和* $ application_folder *变量中的域文件夹。我希望这有帮助/

/*
|---------------------------------------------------------------
| SET THE SERVER PATH
|---------------------------------------------------------------
|
| Let's attempt to determine the full-server path to the "system"
| folder in order to reduce the possibility of path problems.
| Note: We only attempt this if the user hasn't specified a 
| full server path.
|
*/
if (strpos($system_folder, '/') === FALSE)
{
    if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
    {
        $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
    }
}
else
{
    // Swap directory separators to Unix style for consistency
    $system_folder = str_replace("\\", "/", $system_folder); 
}
© www.soinside.com 2019 - 2024. All rights reserved.