Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.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 代码点火器。Web应用程序在本地运行良好,但在live server中它只加载主页_Php_Codeigniter - Fatal编程技术网

Php 代码点火器。Web应用程序在本地运行良好,但在live server中它只加载主页

Php 代码点火器。Web应用程序在本地运行良好,但在live server中它只加载主页,php,codeigniter,Php,Codeigniter,我目前使用Codeigniter框架在一个web应用程序中工作。它在本地与Wampserver32配合得很好,但是当将它传递到一个活动的apache服务器时,它只加载主页,当我尝试路由到另一个页面时,它会显示:错误-404 我已经尝试过改变: 1-$config['index_page']='index.php'到$config['index_page']='index.php' 2-$config['uri_protocol']='REQUEST_uri'至$config['uri_proto

我目前使用
Codeigniter
框架在一个web应用程序中工作。它在本地与
Wampserver32
配合得很好,但是当将它传递到一个活动的
apache
服务器时,它只加载主页,当我尝试路由到另一个页面时,它会显示:错误-404

我已经尝试过改变:

1-
$config['index_page']='index.php'
$config['index_page']='index.php'

2-
$config['uri_protocol']='REQUEST_uri'
$config['uri_protocol']='PATH_INFO'

我实际上已经封锁了一天


confing.php文件

...
$config['base_url'] = 'http://s661658794.onlinehome.fr/admin';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'PATH_INFO';
...
$route['default_controller'] = 'welcome';
$route['Admin'] = 'admin/Login';
$route['Login'] = 'admin/Login/dashboard';
$route['Home'] = 'admin/Home';
$route['Userinfo'] = 'admin/Usercontroller';
$route['History'] = 'admin/Historycontroller';
$route['Changepassword'] = 'admin/Changepassword';
$route['Notification'] = 'admin/Notification';
$route['Logout'] = 'admin/Login/logout';
$route['Forgotpassword'] = 'admin/Login/Forgotpassword';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 year"
</IfModule>
## EXPIRES CACHING ##


<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
<ifModule mod_headers.c>
    Header set Connection keep-alive
</ifModule>


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]

routes.php文件

...
$config['base_url'] = 'http://s661658794.onlinehome.fr/admin';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'PATH_INFO';
...
$route['default_controller'] = 'welcome';
$route['Admin'] = 'admin/Login';
$route['Login'] = 'admin/Login/dashboard';
$route['Home'] = 'admin/Home';
$route['Userinfo'] = 'admin/Usercontroller';
$route['History'] = 'admin/Historycontroller';
$route['Changepassword'] = 'admin/Changepassword';
$route['Notification'] = 'admin/Notification';
$route['Logout'] = 'admin/Login/logout';
$route['Forgotpassword'] = 'admin/Login/Forgotpassword';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 year"
</IfModule>
## EXPIRES CACHING ##


<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
<ifModule mod_headers.c>
    Header set Connection keep-alive
</ifModule>


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]

.htaccess文件

...
$config['base_url'] = 'http://s661658794.onlinehome.fr/admin';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'PATH_INFO';
...
$route['default_controller'] = 'welcome';
$route['Admin'] = 'admin/Login';
$route['Login'] = 'admin/Login/dashboard';
$route['Home'] = 'admin/Home';
$route['Userinfo'] = 'admin/Usercontroller';
$route['History'] = 'admin/Historycontroller';
$route['Changepassword'] = 'admin/Changepassword';
$route['Notification'] = 'admin/Notification';
$route['Logout'] = 'admin/Login/logout';
$route['Forgotpassword'] = 'admin/Login/Forgotpassword';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 year"
</IfModule>
## EXPIRES CACHING ##


<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
<ifModule mod_headers.c>
    Header set Connection keep-alive
</ifModule>


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]

如果您的index.php文件位于public_html文件夹中的admin内 然后您需要用以下代码替换它

你的代码

重写

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
可能对你有用

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ admin/index.php?/$1 [L,QSA]

如果您的index.php文件位于public_html文件夹中的admin内 然后您需要用以下代码替换它

你的代码

重写

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
可能对你有用

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ admin/index.php?/$1 [L,QSA]


看起来您需要调整应用程序/config/database.php以匹配apache服务器的数据库设置。

看起来您需要调整应用程序/config/database.php以匹配apache服务器的数据库设置。

那里有我们的实时链接吗?您确定上载了.htaccess吗?您是否检查了所有文件/文件夹权限和所有权?相关:您是否消除了该问题?
http://s661658794.onlinehome.fr/admin
首先访问你的URL并检查错误消息嘿,伙计们,我刚刚关闭了服务器,所以链接暂时不起作用。我会把它打开,这样你就可以检查链接了。那里有我们的任何实时链接吗?你确定你上传了。htaccess?您是否检查了所有文件/文件夹权限和所有权?相关:您是否消除了该问题?
http://s661658794.onlinehome.fr/admin
首先访问你的URL并检查错误消息嘿,伙计们,我刚刚关闭了服务器,所以链接暂时不起作用。我要把音量调大,这样你就可以查看链接了!谢谢你的回答。然而,我看不出你建议我改变的东西和我现在拥有的东西有什么不同哦。。很抱歉,答案已更新。让我知道。。如果它工作或现在,我可以帮助你在查蒂我知道在stackoverflow。你能把我加入聊天吗?嘿,安基特!谢谢你的回答。然而,我看不出你建议我改变的东西和我现在拥有的东西有什么不同哦。。很抱歉,答案已更新。让我知道。。如果它工作或现在,我可以帮助你在查蒂我知道在stackoverflow。你能把我加入聊天吗?嘿,笨蛋。我已经调整了database.php文件。但它仍然不起作用。你知道有没有办法检查我的应用程序是否正确连接到数据库?你可以在数据库中进行查找以确认它是否正常工作。通常,当用户提交您的登录表单时,这是通过密码哈希查找完成的。我必须检查数据库中的密码哈希吗?对不起,我不明白。也许这会有帮助:嘿,笨蛋。我已经调整了database.php文件。但它仍然不起作用。你知道有没有办法检查我的应用程序是否正确连接到数据库?你可以在数据库中进行查找以确认它是否正常工作。通常,当用户提交您的登录表单时,这是通过密码哈希查找完成的。我必须检查数据库中的密码哈希吗?对不起,我不明白。也许这会有帮助: