Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii2 symlink(): Cannot create symlink, error code(1314)

Tags:

yii2

I tried to run my Yii2 application on Localhost, XAMPP for PHP 5.6.32 and Windows 8 but I got this error: image1

image2

How do I resolve this problem.

Thanks

like image 804
M.O. Idowu Avatar asked Dec 11 '22 06:12

M.O. Idowu


1 Answers

  • The problem mostly occurs when you don't start the server/Xampp on local with administrative privilege. Try to start Xampp from the control panel if you are on windows.

  • Alternatively, you can use the option to disable the symlink by adding the assetManager setting under the components section in your config file (for yii-advance app it can be the common/config/main.php or the config/web.php in the yii-basic app)

    'components'=>[
         'assetManager' => [
             'linkAssets' => false
         ],
    ]
    

UPDATE

There could be a possibility that you get the above error while running any of the commands on the terminal like while contributing into the yii2 repo you have to run the command php build/build dev/app basic <fork> during which it creates a symlink and throws the above error, and after trying both of the above you still dont get it to work in that case you might have to use the default command prompt for the windows by starting it as an administrator and then run the above command.

like image 60
Muhammad Omer Aslam Avatar answered Feb 03 '23 11:02

Muhammad Omer Aslam