Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install magento 2.0 successfully but backend getting error #1299

Closed
tungmpo opened this issue May 24, 2015 · 21 comments
Closed

Install magento 2.0 successfully but backend getting error #1299

tungmpo opened this issue May 24, 2015 · 21 comments

Comments

@tungmpo
Copy link

tungmpo commented May 24, 2015

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!

@quynhvv
Copy link

quynhvv commented May 25, 2015

@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 notifications@github.com
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
#1299.

Best regards, Quynh Vu Van.

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

Skype: quynh.vv
Mobile: 098 525 2002

@tbondois
Copy link

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.

@jamescowie
Copy link

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.

@jamescowie
Copy link

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

@mazhalai
Copy link
Contributor

@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.

@tungmpo
Copy link
Author

tungmpo commented May 27, 2015

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.

@vpiyappan
Copy link
Contributor

Hi Tungmpo,

Your Steps resolved my admin link not working issue.

Thank you for your information.

Best Regards,
Iyappan Perumal

@sshrewz
Copy link

sshrewz commented Jul 14, 2015

@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.

@sshrewz sshrewz closed this as completed Jul 14, 2015
@tungmpo
Copy link
Author

tungmpo commented Jul 16, 2015

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 notifications@github.com
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
#1299 (comment).

@quynhvv
Copy link

quynhvv commented Jul 17, 2015

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 <notifications@github.com

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 notifications@github.com
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
<#1299 (comment)
.


Reply to this email directly or view it on GitHub
#1299 (comment).

Best regards, Quynh Vu Van.

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

Skype: quynh.vv
Mobile: 098 525 2002

@stAn47
Copy link

stAn47 commented Dec 7, 2015

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

@mitul69
Copy link

mitul69 commented Jan 22, 2016

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>

@0x1ad2
Copy link

0x1ad2 commented Jan 24, 2016

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

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

@akshayjindallab
Copy link

Hi,

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

@mitul69
Copy link

mitul69 commented Feb 25, 2016

Yes i have logged in with the root user in terminal

On Thursday 25 February 2016, Akshay Jindal notifications@github.com
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
#1299 (comment).

*Regards, *

Mitul Patelpatelmit69@gmail.com patelmit69@gmail.com9724757428

@mazhalai
Copy link
Contributor

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

@FayKay
Copy link

FayKay commented Mar 9, 2016

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!

@ghost
Copy link

ghost commented Mar 15, 2016

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

@SyedMuneebb
Copy link

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

@udemethegrtman
Copy link

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

magento-engcom-team pushed a commit that referenced this issue Jan 29, 2018


 - Merge Pull Request magento-engcom/magento2ce#1299 from magento-engcom-team/magento2:batch-14-forwardport-2.3-develop
 - Merged commits:
   1. 99e3a76
   2. 4cfc07e
   3. ea616e0
   4. be55217
   5. 41c52fb
   6. 7f42a67
   7. 1090c8b
   8. c80b5ca
   9. 8077af7
   10. 38e34a8
   11. c13ad85
   12. 9e7bf93
   13. 10a6288
   14. abf31d2
   15. 898a470
   16. c99c3a7
   17. 4537e78
   18. 0bad56f
   19. fd2418e
   20. 946e9e1
@vantoniobta
Copy link

@0x1ad2
running commad

php bin/magento setup:static-content:deploy

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests