Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Codeigniter 2.1.x+;Smarty 3.1.x集成_Php_Codeigniter_Smarty - Fatal编程技术网

Php Codeigniter 2.1.x+;Smarty 3.1.x集成

Php Codeigniter 2.1.x+;Smarty 3.1.x集成,php,codeigniter,smarty,Php,Codeigniter,Smarty,我已经学习了将Smarty 3.1.14集成到CodeIgniter 2.1.3的教程,除了我的链接之外,一切都很好,当我尝试在Smarty文件之间导航时,它会转到ex:是否尝试使用.htaccess 如果您没有尝试过,则进行鸟瞰,看看是否解决了问题: 在文件夹的根目录中创建一个.htaccess文件(在cismartynew/中),复制代码并保存它 RewriteEngine on RewriteBase /cismarty-new RewriteCond %{REQUEST_FILENAME

我已经学习了将Smarty 3.1.14集成到CodeIgniter 2.1.3的教程,除了我的链接之外,一切都很好,当我尝试在Smarty文件之间导航时,它会转到ex:是否尝试使用.htaccess

如果您没有尝试过,则进行鸟瞰,看看是否解决了问题:

在文件夹的根目录中创建一个.htaccess文件(在cismartynew/中),复制代码并保存它

RewriteEngine on
RewriteBase /cismarty-new
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
然后打开codeigniter config.php并将$config['index_page']留空:

$config['index_page'] = '';

PS:记得检查是否激活了Apache的“重写模块”,否则它将无法工作。

可能重复,而不是重复。这不是同一个问题,我集成了CI+Smarty,使用codeigniter,index.php不会出现,我可以转到localhost/site/welcome,它工作正常,但是,当我尝试使用Smarty时,我必须将localhost/site/index.php/welcome放在其中显示它,这才是真正的问题。您是否尝试在config.php中设置
index_页面
config?注意:您的
SCRIPT_NAME
值是正常的,无论如何也不会更改。是的,我在config.php中尝试了index_页面,默认值是$config['index_页面]='index.php';我删除了index.php并将其重命名,但它不起作用