3

I try to install Magento 2 and I have a problem with css and js loading (they are missing). There are a lot of topics about this problem and it seems that the last step of the solution is to run php bin/magento setup:static-content:deploy command (rebuild the static content).

Ok, but how? I have no access to the terminal at my host (actually I don't know too much about it, I just use Magento as an average user). Is there a way to run this command inside Magento? What are the steps to run it? The installation is in a sub directory not in site root.

2 Answers 2

2

There is no way to deploy static-content from within the frontend or admin of Magento 2.

At the least, your hosting company should be able to run this command for you.

  1. Need SSH credentials & access to your server
  2. Login to server using SSH via terminal, putty, etc.
  3. Navigate to Magento 2 root install directory using CLI
  4. Run this command:

_

php bin/magento setup:static-content:deploy
Sign up to request clarification or add additional context in comments.

Comments

0

No, you don't have any other options for deploying content from the admin. You need to deploy static content from the Magento root directory only then you will be able to see CSS and js. Open your Magento 2 root directory and run the below commands: For Windows users- php bin/magento setup:static-content:deploy

For linux users- /opt/lampp/bin/php bin/magento setup:static-content:deploy

Another method is using ssh. For that, you need to login to Cpanel. Through command prompt login to the server using ssh credentials. Then navigate through Magento 2 root directory and run the same commands as given above.

1 Comment

Thank you guys, it's not a good news, the host that I use has a custom interface not like cpanel... By the way it is an "unusual" Magento "feature". I am waiting for something like a simple php script that can (re)generate static content. Thank you again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.