Php 使用yii2+;在该服务器中找不到请求的url;Ubuntu中的xampp
昨天我的应用程序运行顺利。现在,我无法运行该应用程序,当我尝试访问任何url时会显示此错误:Php 使用yii2+;在该服务器中找不到请求的url;Ubuntu中的xampp,php,ubuntu,xampp,yii2,Php,Ubuntu,Xampp,Yii2,昨天我的应用程序运行顺利。现在,我无法运行该应用程序,当我尝试访问任何url时会显示此错误: Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webma
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
错误日志:
[Sat May 28 11:27:23.026525 2016] [:error] [pid 3313] [client 127.0.0.1:39322] script '/opt/lampp/htdocs/project-final/backend/web/index.php' not found or unable to stat
and the access log:
127.0.0.1 - - [28/May/2016:11:28:11 +0200] "GET /project-final/backend/web/index.php HTTP/1.1" 404 1031
127.0.0.1 - - [28/May/2016:11:28:28 +0200] "GET /project-final/backend/web/index.php?r=gii HTTP/1.1" 404 1031
我尝试的第一件事是回到我项目的旧版本,但什么都没发生。之后,我尝试使用自定义url规则或添加推荐的yii2.htaccess文件,同样的情况也发生了。我并没有对xampp配置进行任何更改或添加任何内容,只是进入睡眠状态,当我醒来时,服务器无法工作
我还尝试运行127.0.0.1而不是localhost。我已经创建了一个自定义主机:
127.0.0.1 yii.local
我可以使用访问项目文件树,但URL不再工作
My config/main.php:
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'modules' => [],
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
],
'params' => $params,
];
plase显示您的相关代码..您想看到什么?您正在使用的链接以及最终使用链接/url的代码..例如,我一直使用此url访问gii生成器:现在它不再工作。是否更改了urlManager配置?请显示相关代码..您想看到什么?您正在使用的链接以及最终使用链接/url的代码..例如,我一直使用此url访问gii生成器:现在它不再工作了。您是否更改了urlManager配置?