Closed notsoluckycharm closed 10 years ago
Does your app config contain this line?
'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'),
Yes, It's also worth mentioning I am using the composer yii2 repository as well, though this does not answer your question.
Excerpt from my main.php:
'id' => 'app-backend', 'basePath' => dirname(DIR), 'vendorPath' => dirname(dirname(DIR)) . '/vendor', 'preload' => ['log'], 'controllerNamespace' => 'controllers', 'modules' => [], 'extensions' => require(DIR . '/../../vendor/yii-extensions.php'), 'components' => [ 'request' => [ 'enableCsrfValidation' => true, ],
On Thu, Nov 14, 2013 at 12:48 PM, Qiang Xue notifications@github.comwrote:
Does your app config contain this line?
'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'),
— Reply to this email directly or view it on GitHubhttps://github.com/yiisoft/yii2/issues/1202#issuecomment-28505917 .
'extensions' =>require(__DIR__ . '/../../vendor/yii-extensions.php')
? It should be .../vendor/yiisoft/extensions.php
I noticed your line has /../ and my line has /../../
I took your line and received the following 500 message in my nginx log.
PHP message: PHP Fatal error: require(): Failed opening required '/home/brad/bgunn.com/app/config/../vendor/yii-extensions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/brad/ bgunn.com/app/config/main.php on line 19" while reading response header from upstream, client: 24.103.114.217, server: bgunn.com, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm/php5-fpm.sock:", host: "bgunn.com"
I do indeed have this directory structure by the way that should be compatible with the configuration files.
bgunn.com// is root
//app/ -- app root //vendor/yii-extensions.php -- composer loaded vendor root //www/index.php -- web root
Perhaps it's simply broken via composer loading? I do not have a vendor directory within my application code directory.
On Thu, Nov 14, 2013 at 12:52 PM, Brad Gunn hevean@gmail.com wrote:
Yes, It's also worth mentioning I am using the composer yii2 repository as well, though this does not answer your question.
Excerpt from my main.php:
'id' => 'app-backend', 'basePath' => dirname(DIR), 'vendorPath' => dirname(dirname(DIR)) . '/vendor', 'preload' => ['log'], 'controllerNamespace' => 'controllers', 'modules' => [], 'extensions' => require(DIR . '/../../vendor/yii-extensions.php'), 'components' => [ 'request' => [ 'enableCsrfValidation' => true, ],
On Thu, Nov 14, 2013 at 12:48 PM, Qiang Xue notifications@github.comwrote:
Does your app config contain this line?
'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'),
— Reply to this email directly or view it on GitHubhttps://github.com/yiisoft/yii2/issues/1202#issuecomment-28505917 .
I was quoting your code. It's incorrect. You should fix it to be something like vendor/yiisoft/extensions.php.
Well, I'll try to fix this on my own. But I'm telling you what worked yesterday for me no longer works today for me.
I'll update you when I find the solution, by the way, this is the contents of my yii-extensions.php
<?php return [];
I'm trying to locate if this is correct.
yii-extensions.php is no longer used (this change was introduced about two weeks ago). As I said, you just need to change to use yiisoft/extensions.php. There's nothing more you need to do.
You are absolutely correct. I am sorry for not paying close enough attention to the small differences in the file system paths. I dismissed it because I am still having the same problem, though. Thank you for your patience.
"Class 'yii\bootstrap\BootstrapAsset' not found"
I'll figure it out :]
my config does say this now:
'extensions' => require(DIR . '/../../vendor/yiisoft/extensions.php'),
Things might have changed in the layouts/main.php that I'll take a look at.
If you still have the problem, check the content in extensions.php
to see if it contains an entry for bootstrap. If not, you may try to remove bootstrap from your composer.json, composer update, then put back bootstrap to composer.json and update again.
A lot has changed since I first started playing with Yii2.
My resolution ( for those who may land here from Google ):
Make sure you change your configuration and these extensions have moved to Composer, instead of possibly being baked into Yii2 itself.
Composer:
"require": {
"php": ">=5.3.0",
"yiisoft/yii2": "dev-master",
"yiisoft/yii2-swiftmailer": "dev-master",
"yiisoft/yii2-bootstrap": "dev-master",
"yiisoft/yii2-debug": "dev-master",
"yiisoft/yii2-gii": "dev-master",
Thanks again for your patience qiangxue! Let me know if you need any assistance on coding Yii2. Thanks!
Using the advanced example is now broken due to something that has happened with 'yii\bootstrap*'. If you run the example I am getting the following:
Fatal Error – yii\base\ErrorException Class 'yii\bootstrap\BootstrapAsset' not found
I try to remove it from the app/backend/assets/AppAsset.php so that my config looks like the following:
I then recieve the following error:
Fatal Error – yii\base\ErrorException
Class 'yii\bootstrap\NavBar' not found
I only mildly customized the advanced app, this should be easily reproducible by loading the clean advanced app.
What else can I give you to help out ? Seems something broke with the yii\bootstrap namespace.