【问题标题】:How to integrate codeigniter website from live to local server如何将codeigniter网站从现场集成到本地服务器
【发布时间】:2014-01-15 11:38:36
【问题描述】:

我有一个内置于 codeigniter 的网站源代码。我正在尝试将其设置到本地 wamp 服务器中,但无法正常工作。

我做了以下事情:

  1. 创建数据库名称为“fc2”的 UTF-8 数据库并导入实时服务器数据库。
  2. 通过设置 base_url 配置 aplications/config/config.php。
  3. 通过设置数据库主机、用户名、密码和数据库名称来配置 aplications/config/database.php。

但它不起作用。 (附上截图)。

.htaccess 文件如下所示

请帮我解决这个问题。

提前致谢

【问题讨论】:

  • htaccess 文件呢??
  • 我已经更新了我的问题。请检查一下。
  • 发生了什么错误,页面上是否显示任何内容?
  • php.ini 中的 short_open 标签是 ON 还是 OFF?将其设置为 ON 我在页面标题中看到带有 php 代码的图像
  • @Renish A R:不,它不会在页面上显示任何内容。显示空白页面,但在浏览器选项卡标题中显示 PHP 代码。你可以在附图中看到。

标签: php codeigniter


【解决方案1】:

我认为问题出在 htaccess 上。试试这个

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /FOLDER_NAME/index.php?/$1 [L]

将 FOLDER_NAME 更改为本地目录的名称。

【讨论】:

    【解决方案2】:

    检查你是否在config.php文件中添加了“http://”的base url。如果没有输入“http://”并检查

    【讨论】:

      【解决方案3】:

      请试试这个:

      RewriteEngine on
      
      RewriteCond %{REQUEST_FILENAME} !-d
      
      RewriteRule ^(.*)$ /folder_name/index.php?/$1 [L]
      

      【讨论】:

        【解决方案4】:

        还要检查 php 是否正确安装在堆栈中。

        也许重新安装 WAMP 堆栈可能会有所帮助。

        或者,我很想在 XAMPP 中检查一下它是否与 wamp 相关。

        【讨论】:

          【解决方案5】:

          在 .htaccess 中尝试

          <IfModule mod_rewrite.c>
              RewriteEngine On
              RewriteBase /
          
              RewriteCond %{REQUEST_URI} ^sys.*
              RewriteRule ^(.*)$ /index.php?/$1 [L]
          
              RewriteCond %{REQUEST_URI} ^app.*
              RewriteRule ^(.*)$ /index.php?/$1 [L]
          
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php?/$1 [L]
          </IfModule>
          <IfModule !mod_rewrite.c>
              ErrorDocument 404 /index.php
          </IfModule>
          

          假设 index.php 是您的索引页。

          sys 是您的系统文件夹,app 是您的应用程序文件夹。

          并更改 config.php

          $config['index_page'] = '';
          

          【讨论】:

            猜你喜欢
            • 2018-11-01
            • 1970-01-01
            • 2017-07-30
            • 1970-01-01
            • 1970-01-01
            • 2014-02-26
            • 2018-11-18
            • 1970-01-01
            • 2017-02-02
            相关资源
            最近更新 更多