3

I have installed Magento 2 but for some reason all the css/js/images are not loaded. Below are the steps I follow to install Magento 2

  • Create a sub-domain on cpanel
  • Downloaded Magento and uploaded via FTP to the sub-domain
  • Via cPanel FileManager extracted the tar.gz file
  • Follow the setup wizard (we have MySQL 5.6 and PHP 5.5 - the setup went fine without any problems)

Do I need extra software on my server (like composer)?

I have searched for a solution into this but so far no luck

  • I've tried to change di.xml file but no luck
  • I've tried to run the static-content:deploy but I get errors
  • Backend is working whick means all links – Magento 2 Dec 3 '15 at 10:04
  • the backend also has issues with the css/js/images – Armindo Pereira Dec 3 '15 at 10:20
  • Links are working – Magento 2 Dec 3 '15 at 10:21
  • some links work some dont – Armindo Pereira Dec 3 '15 at 10:41
  • ok try my answer – Magento 2 Dec 3 '15 at 10:42
4

Try to use this command in the terminal:

php bin/magento setup:static-content:deploy

If you are using the Magento 2.1.* on default or development mode try this:

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

Try this. Before trying make sure to make a 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/

  • i've already tried this with no luck. I'm using a CentOS, Apache 2.2.31 – Armindo Pereira Dec 3 '15 at 10:44
  • Try to clear cache session and then check – Magento 2 Dec 3 '15 at 10:45
  • still no luck, but a strange thing is sometimes some image/css/js loads but not completely...the link is formacao.primariu.com/what-is-new.html – Armindo Pereira Dec 3 '15 at 10:56
  • You are upgrade this? – Magento 2 Dec 3 '15 at 10:59
  • 1
    our server dont have composer installed, can be it the cause of the isseu? – Armindo Pereira Dec 3 '15 at 15:03
2

If you are in default or development mode use -f to forcefully download static content. In development mode static content are downloaded automatically.

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

In Production mode,no deed to forcefully depoy.

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

Check these extensions:

PHP Extension curl.
PHP Extension dom.
PHP Extension mcrypt.
PHP Extension simplexml.
PHP Extension spl.
PHP Extension xsl.
PHP Extension intl.
PHP Extension mbstring.
PHP Extension ctype.
PHP Extension hash.
PHP Extension openssl.
PHP Extension zip.
PHP Extension xmlwriter.
PHP Extension gd.
PHP Extension iconv.

Check file permissions:

"{"path":"directorypath/htdocs/magento2/app/etc"}" writable directory permission.
"{"path":"directorypath/htdocs/magento2/var"}" writable directory permission.
"{"path":"directorypath/htdocs/magento2/pub/media"}" writable directory permission.
"{"path":"directorypath/htdocs/magento2/pub/static"}" writable directory permission.

1

You can see my concise and complete answer to the same problem here:

https://magento.stackexchange.com/a/97230/34408

However, I have written an excellent article about it and gathered each and every possible solution to it.

How To Fix Broken Magento 2 Installation

I hope this will solve your problem as it has already been working for so many people.

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.