Magento2: Install magento 2.0 successfully but backend getting error

Created on 24 May 2015  Â·  21Comments  Â·  Source: magento/magento2

Hi,
I have setup magento 2.0 successfully but when i login on backend. i can't click on anything. there are many bugs on console relate to js
magento2_error
Anyone can help me. thank a lots!

bug report

Most helpful comment

Fixed it by running
php bin/magento setup:static-content:deploy
on the command line

credits: http://magento.stackexchange.com/a/48896

All 21 comments

@Nguyen Danh Tung:

The seem you are using wamp server?
You can try update the needed PHP setttings at
PATH_TO_YOUR_WEBROOT_FOLDER/magento2/php.ini.sample

and if you use the wamp server you need to add more bellow configs to your
php.ini:
[xdebug]
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
_xdebug.max_nesting_level = 300_

Hope this help.

On Sun, May 24, 2015 at 2:27 PM, Nguyen Danh Tung [email protected]
wrote:

Hi,
I have setup magento 2.0 successfully but when i login on backend. i can't
click on anything. there are many bugs on console relate to js

[image: magento2_error]
https://cloud.githubusercontent.com/assets/12389930/7787075/d4dd2510-0220-11e5-9dbe-e0767daae85b.png
Anyone can help me. thank a lots!

—
Reply to this email directly or view it on GitHub
https://github.com/magento/magento2/issues/1299.

Best regards, Quynh Vu Van.

http://www.magentocommerce.com/certification/directory/dev/1639183/

Skype: quynh.vv
Mobile: 098 525 2002

I had the same problem with all the resources in /pub/ : 404 errors

When I try to request http://[my_project]/pub, it return me the index page without CSS
When I try to request http://[my_project]/pub/[some existing file of folders], without disabling error display :

Cannot create a symlink for "C:/xampp/htdocs/www/client/mage2/app/design/adminhtml/Magento/backend/web/fonts/admin-icons/admin-icons.woff" and place it to "C:/xampp/htdocs/www/client/mage2/pub/static/adminhtml/Magento/backend/en_US/fonts/admin-icons/admin-icons.woff" Warning!symlink(): Cannot create symlink, error code(1314)

0 C:\xampp\htdocs\www\client\mage2\lib\internal\Magento\Framework\Filesystem\Directory\Write.php(155): Magento\Framework\Filesystem\Driver\File->symlink('C:/xampp/htdocs...', 'C:/xampp/htdocs...', Object(Magento\Framework\Filesystem\Driver\File))

1 C:\xampp\htdocs\www\client\mage2\lib\internal\Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink.php(30): Magento\Framework\Filesystem\Directory\Write->createSymlink('app/design/admi...', 'adminhtml/Magen...', Object(Magento\Framework\Filesystem\Directory\Write))

2 C:\xampp\htdocs\www\client\mage2\lib\internal\Magento\Framework\App\View\Asset\Publisher.php(65): Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink->publishFile(Object(Magento\Framework\Filesystem\Directory\Write), Object(Magento\Framework\Filesystem\Directory\Write), 'app/design/admi...', 'adminhtml/Magen...')

3 C:\xampp\htdocs\www\client\mage2\lib\internal\Magento\Framework\App\View\Asset\Publisher.php(49): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))

4 C:\xampp\htdocs\www\client\mage2\lib\internal\Magento\Framework\App\StaticResource.php(118): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))

5 C:\xampp\htdocs\www\client\mage2\lib\internal\Magento\Framework\App\Bootstrap.php(257): Magento\Framework\App\StaticResource->launch()

6 C:\xampp\htdocs\www\client\mage2\pub\static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))

7 {main}

I use XAMPP on Windows 8 to run my local http server. the PHP function symlink() don't have permission to write UNLESS you start your httpserver as an Administrator. So if you use XAMPP or something like this (WampServer...), try to start it "As an administrator" (right click menu)

Maybe that's the same problem you have.

Hello I am having the same issues in Beta 10. Looking at the issue it seems that on install when the pub assets are created then it is creating the symlink incorrectly.

magento-icon.svg -> /var/www/app/design/adminhtml/Magento/backend/web/images/magento-icon.svg

The path should be:
/var/www/magento2/app/design/adminhtml/Magento/backend/web/images/magento-icon.svg

Notice that the magento2 folder is missing from the generated command. If you check the origin file of the symlink to see if it exists of not I have a feeling we are suffering from the same issue. I have not yet looked into the generator code to see why it is omitting a directory from smylink to locale folder.

If you error is the same as mine and the path to the symlinks is wrong what I had to do was remove ( delete ) pub/static/frontend && adminhtml and then via the new cli run php bin/magento setup:static-content:deploy

I think this was because I have been using this code base for some time and upgrading / moving VM's

@tungmpo Thank you for reporting this issue. Have you tried suggestions from @quynhvv @jialuni and @jamescowie? Please let us know if you are still having issues.

Hi,
I have fixed it. this is my solution

***********_Fix Erorr can't load js and css in back end_**********

  1. enable "developer" mode (add SetEnv MAGE_MODE developer in root .htaccess file)
  2. remove everything, except .htaccess file from pub/static folder
  3. open the web-site
  4. find one of non-loaded jquery resources and open it in the browser

If any exception happens during processing of this resource, the error should be displayed on step 4.
If not, please, look at pub/static folder - it should contain only .htaccess file.

Open up app/etc/di.xml and find the virtualType name="developerMaterialization" section. In that section you'll find an item name="view_preprocessed" that needs to be modified or deleted. You can modify it by changing the contents from Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Delete the files under pub/static to get rid of any existing symlinks. You may want to be careful not to delete the .htaccess file.

Hi Tungmpo,

Your Steps resolved my admin link not working issue.

Thank you for your information.

Best Regards,
Iyappan Perumal

@tungmpo, thank you for updating us with your steps to resolve this issue. Should you encounter additional issues, please don't hesitate to submit a new GitHub issue.

Hello,

Do you know how to call static block at template file in magento 2 ?

Thanks
Regards
Tung Mpo

On Wed, Jul 15, 2015 at 2:25 AM, Sheila Nohe [email protected]
wrote:

@tungmpo https://github.com/tungmpo, thank you for updating us with
your steps to resolve this issue. Should you encounter additional issues,
please don't hesitate to submit a new GitHub issue.

—
Reply to this email directly or view it on GitHub
https://github.com/magento/magento2/issues/1299#issuecomment-121348202.

Please research at
http://devdocs.magento.com/guides/v1.0/frontend-dev-guide/bk-frontend-dev-guide.html

Good luck.

On Thu, Jul 16, 2015 at 10:21 AM, Nguyen Danh Tung <[email protected]

wrote:

Hello,

Do you know how to call static block at template file in magento 2 ?

Thanks
Regards
Tung Mpo

On Wed, Jul 15, 2015 at 2:25 AM, Sheila Nohe [email protected]
wrote:

@tungmpo https://github.com/tungmpo, thank you for updating us with
your steps to resolve this issue. Should you encounter additional issues,
please don't hesitate to submit a new GitHub issue.

—
Reply to this email directly or view it on GitHub
<https://github.com/magento/magento2/issues/1299#issuecomment-121348202
.

—
Reply to this email directly or view it on GitHub
https://github.com/magento/magento2/issues/1299#issuecomment-121815412.

Best regards, Quynh Vu Van.

http://www.magentocommerce.com/certification/directory/dev/1639183/

Skype: quynh.vv
Mobile: 098 525 2002

this is my first try of magento and i am running apache24 + php-fpm (5.5) in chroot on a live enviroment.

php file paths are always seen from within the chroot (/web/magento), i.e. they are not the same as seen from apache service (/srv/www/site_home_chroot/web/magento).

upon the first visit of magento, it created many symlinks in /pub/static which do not point to the proper directory as saw by apache (it just ignored any chroot or php being on a different server)

ideally it would be nice if any symlinks that needs to be used, would be relative to the file location and not to the root folder (which is not known from php). All modern Linux distros should support relative symlinks.

best regards, stan

Just Open the

MAGENTO_ROOT/app/etc/di.xml

and replace below code form line number 574

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

TO

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

Fixed it by running
php bin/magento setup:static-content:deploy
on the command line

credits: http://magento.stackexchange.com/a/48896

Hi,

@tbondois: Have you checked that you are running the command prompt as an administrator.

Yes i have logged in with the root user in terminal

On Thursday 25 February 2016, Akshay Jindal [email protected]
wrote:

Hi,

@tbondois https://github.com/tbondois: Have you checked that you are
running the command prompt as an administrator.

—
Reply to this email directly or view it on GitHub
https://github.com/magento/magento2/issues/1299#issuecomment-188709631.

*Regards, *

_Mitul [email protected] [email protected]_

@mitul69 @akshayjindallab @0x1ad2 please avoid commenting on closed issues. Please create a new one.

Hey,
the solution tungmpo provided works like a charm !!!! Thank you
But i am seem to experience an other issue with the cron job.
I get an error that says :One or more indexers are invalid. Make sure your Magento cron job is running.
Since i am new to magento can somebody provide me with a step by step guide of how to fix this ?
I am trying 2 days and still nothing.
I don't understand how to run a cron job on a localhost.
I read all magento instructions but there are for more advanced level.

Thank you in advance!

You must have a total of three cron jobs as this topic explains. The one you're missing is this one:

*/1 * * * * [path-to-binary] -c [ini-file-path] [your Magento install dir]/bin/magento cron:run [>> [log-file]&]

Note that the cron job must run as your Magento file system owner

Maybe you have missed any step or you are not fulfilling its requirements. You can check this simple guide to install Magento 2 on localhost: Install Magento 2 on Localhost

I have the same issue, in magento 2.18 CE and this is the question on stack exchange. https://goo.gl/nZusVW

@0x1ad2
running commad

php bin/magento setup:static-content:deploy

credits: http://magento.stackexchange.com/a/48896

Was this page helpful?
0 / 5 - 0 ratings