12

magento2 dashboard:

All admin menu links don't work and have a strange icon. Why it's not working? Does anyone have any idea?

I can't do anything.

0

25 Answers 25

26

Below solution worked for me
just try it.
go to app/etc/di.xml

find the line

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 

and Replace it with

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

There is no need to remove any file in any directory.

7
  • My Pleasure!!..Enjoy coding Dhaval... Sep 29, 2016 at 7:47
  • @PriyaPonnusamy, could you explain how and why does this solution work ? In 2.1.x - the code already has this line <argument name="strategiesList" xsi:type="array"> <item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item> <item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item> </argument> Sep 13, 2017 at 9:38
  • You need to have a capital in Copy or it doesn't work. Please update your answer.
    – SR_Magento
    Nov 6, 2017 at 14:21
  • @Vikram have you fixed the issue? Sorry about the delay in my response Nov 9, 2017 at 12:50
  • @PriyaPonnusamy: I am not sure how and why does this solution work ? Nov 9, 2017 at 12:53
13

I hope this will help you

Goto Magento 2 root directory -> pub -> static and remove static folder and remove var/cache, var/composer_home, var/generation, var/page_cache, var/view_preprocessed

Then run,

php bin/magento setup:static-content:deploy

1
  • 1
    Caution while removing pub/static contents do not remove .htaccess file otherwise css and javasrcipt will not render and page will load with text only.
    – PhantomS
    May 22, 2019 at 1:53
3

Disable JS merge from admin:

Go to System->Configuration->Developer

or if Admin menu not working then
Goto database inside table core_config_data change key dev/js/merge_files from 1 to 0

3

Try this Before that take Backup

Remove everything, except .htaccess file from pub/static folder

Open up app/etc/di.xml find the path

“Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink”

and replace to

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Note: Remove entire files and folder under pub/static except .htaccess file.

For More info ref this http://www.dckap.com/blog/magento-2-admin-links-not-working-in-windows/

1
  • Note that this only works in developer mode.
    – Muckee
    Jul 31, 2018 at 11:40
2

try to run this

bin\magento setup:static-content:deploy
0
2

This stumped me momentarily earlier, make sure your magento_root/ directory is accessible through your web server and not just the magento_root/pub/ directory - you can use aliases or change your web root.

5
  • Please can you provide further insight? Allowing access to the entire magento root is less secure, so I'd rather keep the pub folder symlinked. I've already added aliases in my apache2.conf file for the /setup and /upgrade directories, so where would I need it to point to in order to resolve this error.
    – Muckee
    Jul 31, 2018 at 11:01
  • @JoshuaFlood Sorry, this was only relevant to me on Apache and we have since switched to Nginx (which I'd recommend by the way, it works very well in our case).
    – James
    Jul 31, 2018 at 19:19
  • Ok thanks! I did just read about 10 minutes ago that people are having much more success with nginx. Could I also ask how you've set up the rest of your stack, or at least whether you use varnish and which version? I'm having trouble running varnish 5 with magento on ubuntu 18.04 but not sure if its bionic or I just need to downgrade to varnish 4.
    – Muckee
    Aug 8, 2018 at 10:29
  • @JoshuaFlood Stack is straightforward, Ubuntu (16.04) -> Varnish (4.1) ->Nginx (1.10) -> PHP-FPM (7.2). We also utilise Redis to share sessions and cache between our frontend servers. We've just stuck with Varnish 4.1 because it works and is rock solid but that means I haven't looked at any upgrade yet so I can't comment on possible problems with 5.x...
    – James
    Aug 8, 2018 at 13:54
  • Ah OK thanks. I'll give it a go on 4. Getting all kinds of problems with ports
    – Muckee
    Aug 10, 2018 at 14:04
2

Goto Magento 2 root directory -> pub -> static and remove static folder and remove var/cache, var/composer_home, var/generation, var/page_cache, var/view_preprocessed

Then run, php bin/magento setup:static-content:deploy

and them

app/etc/di.xml

Go to the line number 574 line:

Older line:

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

Replace it with (New line)

Magento\Framework\App\View\Asset\MaterializationStrategy\copy

0 down vote

I just did the following:

cd magento2 folder
run shell command

My System:

magento 2.0.2
xampp 7.0.3
windows 7

Justin@GATEWAY f:\xampp\htdocs\mag2

php -f bin/magento setup:static-content:deploy
1
  • Note that editing the Symlink entry in di.xml only affects websites in Developer mode.
    – Muckee
    Jul 31, 2018 at 11:41
1

I applied all of the above fixes but there's one thing that is left unmentioned...

When I went to edit I had to change permissions on the folder to be able to save the changes. After I saved the edit to di.xml, I changed the permissions back to 444, Deleted all cache files, and reloaded. It didn't work.

After a few tries, I left the write permission on the folder, deleted cache, and only then did the fix take place.

1

Follow the below steps and it should for you

Step 1. Deleted the static folder using rm -R static/*

Step 2. Cleared cache php bin/magento cache:clean & php bin/magento cache:flush

Step 3. Reran compile php bin/magento setup:di:compile

Step 4. Generated static content php bin/magento setup:static-content:deploy

Step 5. Changed permissions to 777 for pub/static folder chmod 777 -R . /static

Followed those steps and my admin backend loaded fine.

1

it worked fine for me Magento 2.3.4

  1. put magento in maintenance mode from the command console

    bin/magento maintenance:enable

  2. delete everything from pub/static

do not delete .htaccess file

  1. now use the command line

    bin/magento setup:static-content:deploy en_AU -f

give it 5 minutes to complete

en_AU is Australian english so you make sure you use your own preffered language

  1. once its done now clean and flush cache.

    bin/magento cache:clean

    bin/magento cache:flush

  2. Disable maintenance mode

    bin/magento maintenance:disable

0

Hi I having solution of the above problem.

open the terminal and navigate to magento web root

$ cd /var/www/html/MagentoFolder

$ php bin/magento setup:static-content:deploy
1
  • it is giving this error in magento2.0: PHP Fatal error: Class 'DOMDocument' not found in /var/www/html/magento2/vendor/magento/framework/Config/Dom.php on line 364 Sep 14, 2017 at 10:00
0

Same here, just solved by going to: app/etc/di.xml

Replacing: Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink for:

Magento\Framework\App\View\Asset\MaterializationStrategy\copy

Refresh your browser and bingo!!

0

It's happening because of css and js are not rendering properly.

You should use CLI for compiling magento.

Here is a screenshot of my cmd usage. Please change your magento folder location as your magento folder structure. enter image description here

It will take some to complete.

0

If you use different languages on admin and frontend, For example, Admin en_US and front end nl_NL put them both in the same language.

You can change admin language from the admin panel by clicking on admin in the right upper corner and then Account Setting (your account name)

After this run :

php bin/magento setup:static-content:deploy en_US

or

php bin/magento setup:static-content:deploy nl_NL

or whatever your language is (or installed language pack)

php bin/magento setup:static-content:deploy your_LANGUAGE

edit:

It is possible to run the above command for multiple languages. Example:

php bin/magento setup:static-content:deploy nl_NL en_GB en_US

Hope it helps

0

edit di.xml

<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>
                <item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>

change to

<arguments>
            <argument name="strategiesList" xsi:type="array">
                <item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
                <item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
            </argument>

after that deploy and reindex, the problem will be solved admin panel will work fine.

0
  1. First delete everything from pub/static folder except the .htaccess file
  2. Secondly find

    Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

in app/etc/di.xml file and replace it with

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
0

Add one more row to core_config_data table path = dev/static/sign set value to 0.

0

For me, the problem is that I was executing setup:static-content:deploy en_GB in order to match my website's locale, however I had not changed the default language of the admin user to en_GB, so the admin page was trying to locate resources from the en_US directory which, of course, was never created.

One solution would be to run setup:static-content:deploy en_US, generating the missing files. However, this would involve generating static content, logging in to the admin panel, changing the default language of the admin user, then deleting static content and re-generating.

In order to utilise the existing static content, I navigated to the admin_user table in my Magento database and located the row corresponding to the admin user in question, then changed the value of interface_locale to en_GB.

Minified JS and CSS work perfectly in this case.

0

Steps:

  • Open Command Prompt
  • Go to Path C:\xampp\htdocs\magento
  • Write a command ---

php bin/magento setup:static-content:deploy -f

  • Now, Run the admin panel.

Hopefully, It might be helpful.

Thanks!

Sid

0

This problem is usually caused by Magento's cache and Web Browser's cache.

Follow the steps below to resolve it:

  1. Make sure there's a .htaccess file inside /pub/static folder.
  2. Set permission of /pub/static folder to writable permission (0755).
  3. Deploy your view: bin/magento setup:static-content:deploy -f
  4. Press Ctrl + F5 when viewing the admin page to refresh your Web Browser's cache (important)

Hope this helps!

0

Open \app\etc\di.xml in Line No. 715

<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>
 Replace To 
<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>

It Will Be definitely Work

0

I update 2.2.6 to 2.2.7

not this below salutation not working on 2.2.7

find the line

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

and Replace it with

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

There is no need to remove any file in any directory.

0
php bin/magento cache:clean 
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy

execute the above commands i hope its working fine.

0

This worked for me:

Delete all folders under pub/static | Except for .htaccess
Delete var/cache
Delete var/composer_home
Delete var/generation
Delete var/page_cache
Delete var/view_preprocessed

Run:

$ bin/magento setup:static-content:deploy -f
-2

set right folder/file permissions

find . -type f -exec chmod 644 {} \; &&  find . -type d -exec chmod 755 {} \; && find ./var -type d -exec chmod 777 {} \; && find ./pub/media -type d -exec chmod 777 {} \; && find ./pub/static -type d -exec chmod 777 {} \; && chmod 777 ./app/etc  && chmod 644 ./app/etc/*.xml


chown -R :<web server group> .
1
  • Downvoted because of 777
    – Muckee
    Jul 31, 2018 at 11:04

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.