Dominus77 / yii2-advanced-start

Yii2 Start Project Advanced Template
https://dominus77.github.io/yii2-advanced-start/
MIT License
23 stars 12 forks source link

Error load bootstrap #34

Closed kinzinho666 closed 4 years ago

kinzinho666 commented 4 years ago

boostrap url worng

php yii serve --port=8888 Document root "C:\xampp\htdocs\sistema1\console/web" does not exist.

so... i use

php yii serve --docroot="backend/web/" --port=8888

Running Ok, but when a load page, assests dont load.

Not Found The requested resource /admin/assets/5efe5e8b/css/bootstrap.css?v=1599183088 was not found on this server.

if i try without "/admin/' it´s OK assets/5efe5e8b/css/bootstrap.css?v=1599183088

/*!

Files: common/config/bootstrap.php

Yii::setAlias('@common', dirname(__DIR__)); Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend'); Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend'); Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console'); Yii::setAlias('@modules', dirname(dirname(__DIR__)) . '/modules'); Yii::setAlias('@api', dirname(dirname(__DIR__)) . '/api'); Yii::setAlias('@upload', dirname(dirname(__DIR__)) . '/frontend/web/');

common/config/params-local.php return [ 'user.passwordResetTokenExpire' => 3600, 'domainFrontend' => 'http://localhost:8888', 'domainBackend' => 'http://localhost:8888/admin', 'frontendUrl' => 'http://localhost:8888', 'backendUrl' => 'http://localhost:8888/admin' ];

Dominus77 commented 4 years ago

Hello, to run your application this way you need to change the settings in backend/config/main.php the homeUrl and baseUrl of the component request are the same as in the frontend

https://github.com/Dominus77/yii2-advanced-start/blob/000e1f1103a98361bf52a309905a81d057023b3e/backend/config/main.php#L29

'homeUrl' => '/',

https://github.com/Dominus77/yii2-advanced-start/blob/000e1f1103a98361bf52a309905a81d057023b3e/backend/config/main.php#L64

'baseUrl' => ''

It is not recommended to run the application in this way, it is best to install a development environment and run in it, for example XAMPP