在IIS 7上部署CodeIgniter 1.7.2应用程序
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在IIS 7上部署CodeIgniter 1.7.2应用程序相关的知识,希望对你有一定的参考价值。
我在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:abcwwwrootsystemcodeigniterCodeIgniter.php on line 38
Warning: require(system/codeigniter/Common.php) [function.require]: failed to open stream: No such file or directory in c:abcwwwrootsystemcodeigniterCodeIgniter.php on line 38
Fatal error: require() [function.require]: Failed opening required 'system/codeigniter/Common.php' (include_path='C:Program Files (x86)PHPpear;./;./includes;./pear') in c:abcwwwrootsystemcodeigniterCodeIgniter.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
来部署网站。
答案
也许这就是它?您应该在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);
}
以上是关于在IIS 7上部署CodeIgniter 1.7.2应用程序的主要内容,如果未能解决你的问题,请参考以下文章
将 SQL CE 4 部署到 IIS 7 - 需要特殊权限?
ASP.NET Web API 应用程序在 IIS 7 上部署时提供 404
CodeIgniter 错误报告 1.7.x 和 2.x 之间的区别
带有 web.config 文件的 IIS 上的 Codeigniter 2