cancel
Showing results for 
Search instead for 
Did you mean: 

CSS/JQuery won't show up after clean installation of Magento 2.3

SOLVED

CSS/JQuery won't show up after clean installation of Magento 2.3

 Hi everyone,

 

I am working for two days on this and couldn't make everything work... before you read it, note that I've tried every solution I could find on stackoverflow, quara and more.

 

So:

These are the steps I took:

  1. Opened a new instance of EC2
  2. Edited php.ini file (version 7.1) as follows:
    1. memory_limit = 256M
    2. cgi.fix_pathinfo = 0
    3. max_execution_time = 1800
    4. max_input_time = 1800
    5. upload_max_filesize = 100M
  3. Installed Magento 2.3
  4. Ran the following commands for premissions (I know it's not ideal, the purpose is testing whether it's working or not):
    1. sudo chown -R www-data:www-data /var/www/html/magento/
    2. sudo chmod -R 777 /var/www/html/magento/
  5. created a magento.confg in sites-available (apache2):
    1. everything is standard besides the serverName and Server alias which is my <domain name>/magento (magento folder inside the www/html folder). Before you say anything - that's the only way I managed to make it work.
  6. enabled rewrite (sudo a2enmod rewrite)

Current situation: pages are working, admin panel works, pictures are apparent, however, CSS/Javascript doesn't work (getting 404 in chrome dev tools).

 

I've tried cleaning the cache manually and with:

sudo bin/magento cache:clean

I've tried deploying static content:
sudo php bin/magento setup:static-content:deploy -f

I've tried standard deployment:

sudo bin/magento setup:static-content:deploy -f -s standard

 

I've tried to reconfigure the 'web/unsecure/base_url' and 'web/secure/base_url' with /magento prefix and without.

 

I've tried to delete static content inside the pub/static folder.

 

Here is the link to the website:

http://35.161.56.182/magento

 

Hope you will be able to help me.

Best Regards,

Moshe.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: CSS/JQuery won't show up after clean installation of Magento 2.3

Hello @moshe_biton

 

Please check .htaccess file once in pub and pub/static folder. If file is missing then upload this.

 

If this will not work then run below commands:

chmod -R 0777 var/ pub/ generated/
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f en_US
php bin/magento cache:flush
chmod -R 0777 var/ pub/ generated/
Manish Mittal
https://www.manishmittal.com/

View solution in original post

4 REPLIES 4

Re: CSS/JQuery won't show up after clean installation of Magento 2.3

Hello @moshe_biton

 

Please check .htaccess file once in pub and pub/static folder. If file is missing then upload this.

 

If this will not work then run below commands:

chmod -R 0777 var/ pub/ generated/
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f en_US
php bin/magento cache:flush
chmod -R 0777 var/ pub/ generated/
Manish Mittal
https://www.manishmittal.com/

Re: CSS/JQuery won't show up after clean installation of Magento 2.3

Didn't work...

Re: CSS/JQuery won't show up after clean installation of Magento 2.3

I've already tried it before and it didn't work, but somehow, it does right now. 

 

Thanks Smiley Happy

Re: CSS/JQuery won't show up after clean installation of Magento 2.3

@moshe_biton

 

Glad to hear. cheers

Manish Mittal
https://www.manishmittal.com/