0

I have moved my existing Yii2 website to a new server but I am unable to access it. It throws below error

Invalid Configuration – yii\base\InvalidConfigException The directory does not exist: /home/domain_path/assets

enter image description here

but the same app is working in the old server without having assets folder at the root.

Is there an issue with runtime folder?

8
  • please check your folder permissions. it needs permission to create assets
    – Mahsa
    Jan 17, 2019 at 7:22
  • Not an issue with permission. It's 777. It is looking for folder in root where it should not look Jan 17, 2019 at 7:26
  • asset and runtime folder are required in yii2
    – Mahsa
    Jan 17, 2019 at 7:37
  • are u using Shared Hosting Environment?
    – Mahsa
    Jan 17, 2019 at 7:39
  • asset and runtime folders are there with permission. same project working in old server and I had problem that time and fixed but not remember Jan 17, 2019 at 8:03

2 Answers 2

2

The problem is you are missing assets folder in the webroot/web directory.

The value of $this->basePath is currently false (you can print the value to see it).

So I fixed it by adding assets folder to /web directory.

1
  • This worked! I have a Yii2 app running inside of Docker, and I was getting this error when loading the /debug page in the browser. I went to the main folder in my IDE, directory /web, created a new directory called assets, and now I am able to see the debug page just fine. Feb 26 at 11:55
0

add directory assets to frontend/web or enother directory, which respond about your front

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 16, 2021 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.