1

I want to install Magento 2.0 on a server with Centos system. My problem is after installation the Admin Panel is look like in this image:

admin panel error

In the firebug console I have a lot of 404 errors:

"NetworkError: 404 Not Found - http://example.com/pub/static/frontend/Magento/luma/en_US/requirejs/require.js"

"NetworkError: 404 Not Found - http://example.com/pub/static/frontend/Magento/luma/en_US/css/styles-l.css"

"NetworkError: 404 Not Found - http://example.com/pub/static/frontend/Magento/luma/en_US/css/styles-m.css"

"NetworkError: 404 Not Found - http://example.com/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js"

"NetworkError: 404 Not Found - http://example.com/pub/static/frontend/Magento/luma/en_US/mage/calendar.css"

"NetworkError: 404 Not Found - http://example.com/pub/static/frontend/Magento/luma/en_US/css/print.css"

"NetworkError: 404 Not Found - http://example.com/pub/static/_requirejs/frontend/Magento/luma/en_US/requirejs-config.js"

ReferenceError: require is not defined

I try to see what permissions are int hat folder pub/static/ with a ftp client and there are 770, so with my ftp user I get there permissions denied. I try to use:

php bin/magento setup:static-content:deploy 

but nothing happend.

How I can solve this?

1
1

Magento 2 has extensive documentation of the installation process. See here for post-installation verification and troubleshooting: http://devdocs.magento.com/guides/v2.0/install-gde/install/verify.html

In particular, your problem sounds like the exact problem detailed here: http://devdocs.magento.com/guides/v2.0/install-gde/trouble/tshoot_no-styles.html

This could be caused by rewrites not working, or by incorrect file permissions. Broken rewrites could be a result of apache being configured with AllowOverride None, or some such, preventing Magento's .htaccess from executing. (I would expect that to also break the admin URL, though, so may not be that.)

Permissions setup is detailed here: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/integrator_install.html#instgde-prereq-compose-access

In particular, given SSH access:

File system permissions and ownership (per official M2 documentation)

  1. Change to the Magento installation directory:

    cd <web server docroot>/<magento2 base dir>

  2. Set ownership:

    chown -R :<your web server group name> .

    Typical examples:

    CentOS: chown -R :apache .
    Ubuntu: chown -R :www-data .

  3. Set permissions:

    find . -type d -exec chmod 770 {} \; && find . -type f -exec chmod 660 {} \; && chmod u+x bin/magento

    If you must enter the commands as sudo, use:

    sudo find . -type d -exec chmod 770 {} \; && sudo find . -type f -exec chmod 660 {} \; && sudo chmod u+x bin/magento

5
  • thank you for your answer, i try to use this permissions but i have this error now: NetworkError: 403 Forbidden
    – Robert
    Jan 22 '16 at 14:13
  • You can enable developer mode to see errors in the browser, you can try curling the URL to see if there's a more informative response header, or you can look in your web server logs. Please post any error messages here. Jan 22 '16 at 14:50
  • Hi thank you, i see now the admin url is something like this, i think is not correct: www.example.co/admin/admin/dashboard/index/key/d1c029ca7481152a590e40d909a8604e5bcc470876886227b13aa98368b97be6/
    – Robert
    Jan 23 '16 at 9:38
  • @RobertD that admin URL appears correct.
    – Ryan Hoerr
    Jan 23 '16 at 14:23
  • i try everything, i reinstall the server again, the problem is still there, any idea what i can try? or how I can find what is the problem?
    – Robert
    Jan 24 '16 at 10:18
2

You are probably running in production mode and forgot to run:

bin/magento setup:static-content:deploy
0

I'm new for this kind of installation. I got this problem, too. I can resolve by run this command:

/var/www/html/magento2$ php bin/magento setup:static-content:deploy

I also face with accessing the admin page, which I can resolve by editing apache configuration file : vi /etc/httpd/conf/httpd.conf as:

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>
<Directory "/var/www">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
<Directory "/var/www/html">
   Options Indexes FollowSymLinks
   AllowOverride All
   Require all granted
</Directory>

My system environment: - CentOS v7.1 - Apache v2.4.6 - PHP v5.6.24 - MySQL 5.6.31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.