Tudou

第 260 位会员

会员
个人信息
  • 加入于 2017-11-29 15:45:00
  • 最后登录时间 10个月前
  • 签名 一路摸索向前缓行
个人成就
  • 发表文章次数 10
  • 发布回复次数 36
  • 个人主页浏览次数 17
LINUX系统对大小写敏感之重写数据库配置文件之后无法找到10个月前

我体谅你,毕竟每天那么多人都有问题要问你,有时候烦躁是很正常的。说出来你可能不信,我其实核对过的。:pensive:哈哈哈,感谢感谢

LINUX系统对大小写敏感之重写数据库配置文件之后无法找到10个月前

我是榆木,我笨,但是大哥能不能看在我才上班1个月的份上,不要生我气了。 问题已经解决了 就是大哥说的这个方法。很管用,我其他几个地方对比了一下,也有相似的错误。正在修改中。 感谢。

LINUX系统对大小写敏感之重写数据库配置文件之后无法找到10个月前

我在控制器测试了,返回一个数值是可以的,就是通过调用服务层的时候有问题。 bolck 层调用common配置:** $this->_service = Yii::$service->sitesmanage; ** common配置在 ** fecshop/common/config/fecshop_local_services/Sitesmanage.php **内容如下:

return [
'sitesmanage' => [
    'class' => 'appadmin\local\local_services\Sitesmanage',
],
];

然后对应的service层内容大致如下:

class Sitesmanage extends Service
{
//站点表
protected $_sitesModelName    = '\appadmin\local\local_models\mysqldb\Shopconfig';
protected $_sitesModel;
//订单表
protected $_orderModelName    = '\appadmin\local\local_models\mysqldb\order\Orderinfo';
protected $_orderModel;

public function __construct(){
    list($this->_sitesModelName,$this->_sitesModel)       = \Yii::mapGet($this->_sitesModelName);
    list($this->_orderModelName,$this->_orderModel)       = \Yii::mapGet($this->_orderModelName);
}
}

最后的数据库**fecshop/appadmin/local/local_models/mysqldb/order/OrderInfo.php**内容:

use yii\db\ActiveRecord;

class OrderInfo extends ActiveRecord
{
public static function tableName()
{
    return "sales_flat_order";
}
}

报错信息则如下:

Http status: 500 Internal Server Error

ajaxOptions: error

thrownError: Internal Server Error

PHP Fatal Error 'yii\base\ErrorException' with message 'Class '\appadmin\local\local_models\mysqldb\order\Orderinfo' not found'
in /var/html/www/fecshop/vendor/fancyecommerce/fecshop/yii/Yii.php:42
Stack trace:
0 [internal function]: yii\base\ErrorHandler->handleFatalError()
1 {main}
LINUX系统对大小写敏感之重写数据库配置文件之后无法找到10个月前

看过了 我尝试改过。但是报更多的错了,报的是代码有问题,但是我在本地改过之后运行却不影响。。有点头大,服务器好像linux的,大小写比较严谨,我再看看吧 谢了。等我测试成功再来回帖。

LINUX系统对大小写敏感之重写数据库配置文件之后无法找到10个月前

因为我是模仿的其他的写法写的, 我以为路由方法就是这样。:frowning:

这个配置的时候 model中Xxx.php首字母大写,在服务层调用时,'\appadmin\local\local_models\mysqldb\Xxx'也应该这样吗?因为我是模仿的其他文件的,而且写出来在本地也能访问。

LINUX系统对大小写敏感之重写数据库配置文件之后无法找到10个月前

文件存在,而且也是大写,我是用的win, 环境都搭在win上的,如果要换还得装虚拟机,重新搭建环境。现在就想弄个测试版出来先看看。

感觉是某个配置文件的问题,因为每个都是报的同样的错误,只是文件名不一样而已。

LINUX系统对大小写敏感之重写数据库配置文件之后无法找到10个月前

admin\config中的配置文件一个都没少。

10个月前

是需要修改assets文件夹的读写权限吗?

10个月前

@Terry #1楼 我现在就改了这些。common/local_server/image.php我也核对过都是没问题的。admin 中的配置文件我也核对过。其他我就不知道该查哪里了

10个月前

我修改了fecshop/common/config/main-local.php 中的内容

return [
'components' => [
    'db' => [
        'class'    => 'yii\db\Connection',
        'dsn'      => 'mysql:host=localhost;dbname=fecshop',
        'username' => '账号',//chenjq_db
        'password' => '密码',
        'charset'  => 'utf8',
    ],
    'mongodb' => [
        'class' => 'yii\mongodb\Connection',
        // 有账户的配置
        //'dsn' => 'mongodb://username:password@localhost:27017/datebase',
        // 无账户的配置
        'dsn' => 'mongodb://IP/连接名',
    ],
    'mailer' => [
        'class'    => 'yii\swiftmailer\Mailer',
        'viewPath' => '@common/mail',
        // send all mails to a file by default. You have to set
        // 'useFileTransport' to false and configure a transport
        // for the mailer to send real emails.
        'useFileTransport' => true,
    ],

    'redis' => [
        'class'    => 'yii\redis\Connection',
        'hostname' => 'IP',
        'port'     => 6379,
        //'password'  => '密码',

    ],
],

];

10个月前

报错信息重新发一次吧:

标题:
Invalid Configuration – yii\base\InvalidConfigException
The directory is not writable by the Web process: /var/html/www/fecshop/appadmin/web/assets

内容: 内容:

1. in /var/html/www/fecshop/vendor/yiisoft/yii2/web/AssetManager.php at line 215
206207208209210211212213214215216217218219220221222223224     * @throws InvalidConfigException if [[basePath]] is invalid
 */
public function init()
{
    parent::init();
    $this->basePath = Yii::getAlias($this->basePath);
    if (!is_dir($this->basePath)) {
        throw new InvalidConfigException("The directory does not exist: {$this->basePath}");
    } elseif (!is_writable($this->basePath)) {
        throw new InvalidConfigException("The directory is not writable by the Web process: {$this->basePath}");
    } else {
        $this->basePath = realpath($this->basePath);
    }
    $this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
}

/**
 * Returns the named asset bundle.
 *
2. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/Object.php at line 107 – yii\web\AssetManager::init()
3. yii\base\Object::__construct(['forceCopy' => false])
4. in /var/html/www/fecshop/vendor/yiisoft/yii2/di/Container.php at line 381 – ReflectionClass::newInstanceArgs([['forceCopy' => false]])
5. in /var/html/www/fecshop/vendor/yiisoft/yii2/di/Container.php at line 156 – yii\di\Container::build('yii\web\AssetManager', [], ['forceCopy' => false])
6. in /var/html/www/fecshop/vendor/yiisoft/yii2/BaseYii.php at line 348 – yii\di\Container::get('yii\web\AssetManager', [], ['forceCopy' => false])
7. in /var/html/www/fecshop/vendor/yiisoft/yii2/di/ServiceLocator.php at line 135 – yii\BaseYii::createObject(['forceCopy' => false, 'class' => 'yii\web\AssetManager'])
8. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/Application.php at line 605 – yii\di\ServiceLocator::get('assetManager')
9. in /var/html/www/fecshop/vendor/yiisoft/yii2/web/View.php at line 225 – yii\base\Application::getAssetManager()
10. in /var/html/www/fecshop/vendor/yiisoft/yii2/web/View.php at line 285 – yii\web\View::getAssetManager()
11. in /var/html/www/fecshop/vendor/yiisoft/yii2/web/AssetBundle.php at line 125 – yii\web\View::registerAssetBundle('yii\web\JqueryAsset')
12. in /var/html/www/fecshop/vendor/yiisoft/yii2/web/View.php at line 443 – yii\web\AssetBundle::register(yii\web\View)
13. in /var/html/www/fecshop/vendor/fancyecommerce/fec_admin/views/login/index.php at line 55 – yii\web\View::registerJs('  $(document).ready(function(...', 5)
10个月前

点击修改的时候 最下方就报这个错误

10个月前

最下方报错:

r\nregisterJs($this->blocks['js_end'],\\yii\\web\\View::POS_LOAD); ?>\r\n14. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/View.php at line 330 – require('/var/html/www/fecshop/vendor/fan...')\r\n15. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/View.php at line 250 – yii\\base\\View::renderPhpFile('/var/html/www/fecshop/vendor/fan...', ['error' => ''])\r\n16. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/View.php at line 152 – yii\\base\\View::renderFile('/var/html/www/fecshop/vendor/fan...', ['error' => ''], fecadmin\\controllers\\LoginController)\r\n17. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/Controller.php at line 381 – yii\\base\\View::render('index', ['error' => ''], fecadmin\\controllers\\LoginController)\r\n18. in /var/html/www/fecshop/vendor/fancyecommerce/fec_admin/controllers/LoginController.php at line 138 – yii\\base\\Controller::render('index', ['error' => ''])\r\n132133134135136137138139140141142143144 return $this->redirect(\"/\")->send();\r\n }else{\r\n $errors = CModel::getErrorStr($AdminUserLogin->errors);\r\n }\r\n }\r\n $this->layout = \"login.php\";\t\r\n return $this->render('index',['error' => $errors]);\r\n }\r\n \r\n \r\n \r\n \r\n \r\n19. fecadmin\\controllers\\LoginController::actionIndex()\r\n20. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array([fecadmin\\controllers\\LoginController, 'actionIndex'], [])\r\n21. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/Controller.php at line 156 – yii\\base\\InlineAction::runWithParams([])\r\n22. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/Module.php at line 523 – yii\\base\\Controller::runAction('index', [])\r\n23. in /var/html/www/fecshop/vendor/yiisoft/yii2/web/Application.php at line 102 – yii\\base\\Module::runAction('fecadmin/login/index', [])\r\n24. in /var/html/www/fecshop/vendor/yiisoft/yii2/base/Application.php at line 380 – yii\\web\\Application::handleRequest(yii\\web\\Request)\r\n25. in /var/html/www/fecshop/appadmin/web/index.php at line 62 – yii\\base\\Application::run()\r\n56575859606162 * 使用方法:Yii::$service->cms->article;\r\n * 上面的例子就是获取cms服务的子服务article。\r\n */\r\nnew fecshop\\services\\Application($config['services']);\r\nunset($config['services']);\r\n$application = new yii\\web\\Application($config);\r\n$application->run();\r\n\r\n请就火力支援。。。。在线等。","name":"Topic[content]","path":"/assets/ed623a17/lib/"}); jQuery('#topic-tags').select2({"width":"100%"}); jQuery('#w0').yiiActiveForm([{"id":"topic-title","name":"title","container":".field-topic-title","input":"#topic-title","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"标题不能为空。"});yii.validation.string(value, messages, {"message":"标题必须是一条字符串。","min":2,"tooShort":"标题应该包含至少2个字符。","max":250,"tooLong":"标题只能包含至多250个字符。","skipOnEmpty":1});}},{"id":"topic-post_meta_id","name":"post_meta_id","container":".field-topic-post_meta_id","input":"#topic-post_meta_id","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"分类不能为空。"});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"分类必须是整数。","skipOnEmpty":1});}},{"id":"topic-content","name":"content","container":".field-topic-content","input":"#topic-content","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"内容不能为空。"});yii.validation.string(value, messages, {"message":"内容必须是一条字符串。","min":2,"tooShort":"内容应该包含至少2个字符。","skipOnEmpty":1});}}], []); });
10个月前

完了 修改不了了@Terry #1楼

关于后台页面之间的跳转11个月前

:joy: 忘记控制台这个东西了。 感谢感谢

后台数据展示(多表联查)11个月前

探索真是有趣的事情啊。

后台数据展示(多表联查)11个月前

解决了 尝试了多重办法之后,最后无心的一个技能解决了。

$query=$this->_spreadModel->find();
    $query->select(array('*','(select msg from '.$this->_msgModel->tableName().' as message where msg_id=message.id) as user_msg','(select spread_type from '.$this->_msgModel->tableName().' as message where msg_id=message.id) as spread_type'));

就是往数组总再次添加一个命令用逗号隔开

Your Site Analytics