首页 文章

如何将codeigniter网站从实时服务器集成到本地服务器

提问于
浏览
2

我有一个内置在codeigniter中的网站源代码 . 我试图将其设置为本地wamp服务器但不能正常工作 .

我做了以下事情:

  • 创建数据库名为"fc2"的数据库UTF-8并导入实时服务器数据库 .

  • 通过设置base_url配置aplications / config / config.php .

  • 通过设置数据库主机,用户名,密码和数据库名称来配置aplications / config / database.php .

但它不起作用 . (附有屏幕截图) .

enter image description here

.htaccess文件看起来像这样

enter image description here

请帮我解决这个问题 .

提前致谢

5 回答

  • 0

    我认为问题在于htaccess . 试试这个

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

    使用本地目录的名称更改FOLDER_NAME .

  • 0

    检查是否已将基本URL放在config.php文件中,并带有“http://” . 如果没有输入“http://”并检查

  • 0

    请试试这个:

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

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

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

    或者我很想知道可能在XAMPP中查看它是否与wamp有关 .

  • 0

    试试.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'] = '';
    

相关问题