cancel
Showing results for 
Search instead for 
Did you mean: 

After Magento 2.3 installation no css and JS loading for frond end and admin

SOLVED

After Magento 2.3 installation no css and JS loading for frond end and admin

Hi All,

 

I have installed Magento 2.3 in my server(cpanel). I have installed it through web setup wizard. After installation success, no css and js is loading for front end and backend. I am not sure what is the issue. Please help.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Hi @Wakralab,

There may be some issue with permissions on the server in generations of static files. And make sure that you have ". htaccass" file in pub/static folder.

Try the following command to setup proper permission to magento directory.

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento
After it run the following magento commands in the sequence.

Upgrade and compile command are optional.

chmod -R 0777 var/ pub/ generated/
rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
php bin/magento indexer:reindex
chmod -R 0777 var/ pub/ generated/

I hope it will help you!

View solution in original post

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Hello @Wakralab ,

As you are using magento 2.1.8, please remove var/generation from your magento root directory by following command:

rm -rf var/generation/*

then compile the code by 

bin/magento setup:di:compile

and then flush your magento cache 

bin/magento cache:flush

 

Check the home page again. Hope this will works for you.

Note: Please provide correct permission to var folder before executing bin/magento setup:di:compile

Regards

View solution in original post

9 REPLIES 9

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

@Wakralab 

 

You need to deploy the static content to make it working. If you have SSH access then deploy the static content. You can find more details for the same on below URL.

 

https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-static-view.html

 

 

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Hi @Wakralab,

There may be some issue with permissions on the server in generations of static files. And make sure that you have ". htaccass" file in pub/static folder.

Try the following command to setup proper permission to magento directory.

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento
After it run the following magento commands in the sequence.

Upgrade and compile command are optional.

chmod -R 0777 var/ pub/ generated/
rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
php bin/magento indexer:reindex
chmod -R 0777 var/ pub/ generated/

I hope it will help you!

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Hello @Wakralab ,

Please provide the permission to your magento directory by executing the following commands:

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

And then deploy the static content of your magento by 

bin/magento setup:static-content:deploy

And then check again on frontend.

Note:  Please check that .htaccass' is present on pub/static forlder.

If it helps you, please accept it as solution and give us kudos.

Thank you.

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Thanks Tarandeep.!  But i have already deployed the static content. Still the same!

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Did you tried above solution shared by me?

Also Make sure that you have ". htaccass" at pub/static folder.

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Hi Vimal,

 

Thanks for the reply. Yes, I have set permissions for the respective folders and also I have .htaccess in the pub static folder. I have installed Magento 2.1.8 and it worked like charm. is there anything I have to do specifically for 2.3.2?

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Great .. you don't need to do anything else for Magento 2.3.2.

Same will work.

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Thanks VImal. But for some reason 2.3.2 not working. SO  i thought of continuing with 2.1.8 only. Not in homepage I m getting this error. after installing the theme 

 


Fatal error: Declaration of Codazon\ProductFilter\Block\Product\ProductsList\Interceptor::getAddToCartPostParams(Magento\Catalog\Model\Product $product, $additional = Array) must be compatible with Codazon\ProductFilter\Block\Product\ProductsList::getAddToCartPostParams(Magento\Catalog\Model\Product $product, $additional = Array): array in /home/perfumedunia/public_html/demo2/var/generation/Codazon/ProductFilter/Block/Product/ProductsList/Interceptor.php on line 7

Re: After Magento 2.3 installation no css and JS loading for frond end and admin

Hello @Wakralab ,

As you are using magento 2.1.8, please remove var/generation from your magento root directory by following command:

rm -rf var/generation/*

then compile the code by 

bin/magento setup:di:compile

and then flush your magento cache 

bin/magento cache:flush

 

Check the home page again. Hope this will works for you.

Note: Please provide correct permission to var folder before executing bin/magento setup:di:compile

Regards