首页 > 解决方案 > General aliases not working in hosting yii2

问题描述

I uploaded a yii2 project to a hosting, while testing the application I noticed that a plugin is not working correctly, checking more in detail and it turns out that the default aliases of yii are not working correctly, that is, it does not show anything.

Example: @web should show / emailsender / web / In this case it does not show it.

This is a screenshot from my localhost: enter image description here

This one from the hosting: enter image description here

im just executing this line to see the alias:

<?php echo Yii::getAlias('@web/'); ?>

The project folder has permissions 0755 as well as subfolders and files like yii.bat and others, permissions 0644.

What could be wrong?. Hope you can help me.

Greetings.

标签: yii2aliasweb-hostingyii2-basic-app

解决方案


Reading Michal answer, the files was pointing between url folder (/var/www/html/...) and not web (http://doman.com/img...), i had to change the configuration of the plugins to the base URL to can access.

Now it works great.

Thanks so much and sorry for bother.

Greetings.


推荐阅读