0

The installation went fine, no errors. I activated also rewriting mode for Apache2. But I found no CSS files:

The inspector shows:

enter image description here

The folder /pub/static has no version folder.

UPDATE: Also I have no backend when I go to localhost/admin.

I didn't delete pub/static after my installation. When I run sudo php bin/magento setup:static-content:deploy I get error :

[BadMethodCallException]
Missing required argument $alternativeSources of Magento\Deploy\Model\Deploy\LocaleDeploy.

6

2 Answers 2

0

First check if your css is loaded, your website -> right click and select view page source or just press ctrl+u. There you'll find your style.css. Check if it is showing this style.css and the right url. Click on it, see if it is loading ok.

It should look like this:

<link rel="stylesheet" type="text/css" href="http://www.exemple.com/skin/frontend/package/theme/css/style.css" media="all" />

For this problem to happen, There are three reasons I know of:

1.) There might be an issue because of System Cache. Clean the cache from the backend or go to magentoroot/var/ and delete the contents of the cache and session folder.

2.) There can be issue with the file permission of your css File. In this case just type the following command in terminal, sudo chmod 777 -R /magentoroot/ (update file permissions after Magento creates these new static files. They are not owned by www-data, so they will give 404.)

3.) Lastly, there could be something wrong with the url in your core_config_data table of your database, which I think you have already checked.

4.) Flush your navigator cache : Ctrl+Shift+R

1
  • The CSS file itself doesnt exist
    – bourax
    May 18, 2017 at 9:37
0

Run following steps and commands from terminal of your magento installation root directory.

Step 1 : Deploy the static content to create symlinks

php bin/magento setup:static-content:deploy

Step 2 : Reindex files

php bin/magento indexer:reindex

Step 3: Enable rewrite module extension

make sure apache “rewrite_module” is enable and then restart the server

Step 4 : Give you WebServer access

$ chown -R www-data:www-data /var/www/html/magento2 

Step 5: Give write permission.

$ chmod -R 777 /var/www/html/magento2 

Step 6: Clean and flush magento cache

php bin/magento cache:clean
php bin/magento cache:flush

Hope this helps you !!

1
  • I get [BadMethodCallException] Missing required argument $alternativeSources of Magento\Deploy\Model\Deploy\LocaleDeploy. when I run your first command
    – bourax
    May 18, 2017 at 9:20

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