How to recover frontend and backend css after deploy command - magento2

I have done below steps but after this frontend and backend css fonts will not working properly in magento2.
Remove pub/static //not .htaccess
Remove var/cache
Remove var/composer_home
Remove var/generation
Remove var/page_cache
Remove var/view_preprocessed
Then open up app/etc/di.xml find the path
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
and replace it with Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
And finally run this:
php bin/magento setup:static-content:deploy

I have been facing strange issue, as the part moving modifications in static content. we removed pub/static and deployed setup:static-content:deploy.
After doing this, files are generated properly in pub/static folder but when i load front end, styles are vanished.
As in the source the file paths are loading with version1483082446
root/static/version1483082446/frontend/Smartwave/porto/en_US/mage/calendar.css
I have followed below commands, but my styles are not loading in frontend.

Delete var/cache var/page_cache generated var/view_proceesed pub/static/frontend pub/static/adminhtml
Perform setup:upgrade di:compile content:deploy cache:flush
Give 777 permission to the pub var and generated folder.

Related

Could not read config file while deploying static content in Magento 2?

It shows error in FileResolver file.
Check {your_theme_dir}/etc/view.xml file,
then, if empty, copy it from Magento_blank theme and run setup:static-content:deploy again.

Images not showing in admin panel as well as no log out option is there.

After completion of Magento 2 Community Edition , Images not showing in admin panel as well as no log out option is there.
You need to regenerate static content files and clear cache. All commands assume that your current folder is magento root folder. Enter the following command:
Regenerate static files:
php bin/magento setup:static-content:deploy
Clean and flush cache:
php bin/magento cache:clean
php bin/magento cache:flush

Unable to get content for 'frontend/Magento/blank/en_US/css/source/lib/_lib.less'

When I compile static with php bin/magento setup:static-content:deploy, I'm getting the following errors:
Unable to get content for 'frontend/Magento/blank/en_US/css/source/lib/_lib.less'
Unable to get content for 'frontend/Magento/luma/en_US/css/source/lib/_lib.less'
I was also facing the same issue. Then I went through the comments from different people on GitHub here. After that I was able to fix by recovering the folder "lib/web/css" or whole "lib/web" under root directory.
Lastly run the command and there was no error :
bin/magento setup:static-content:deploy en_US -f
Based on your setup version you can take it from here : https://github.com/magento/magento2/tree/2.3/lib
Your Magento probably was poorly updated, you might be able to fix it by getting a new composer installation in the same version and replacing your lib folder with a clean lib folder from the native installation.

Css changes reflect only after deploy command in magento2

Now i have created custom theme in magento2.Every time i wrote css it doesn't reflect immediately.I have changed mode to "developer".And also disable cache
in backend.I have given the following commands to reflect my custom css.
rm -f var/* -R
rm -f pub/static -R
php bin/magento setup:static-content:deploy
chmod 0777 var -R
chmod 0777 pub/static -R
It takes too much time to do my design work.So please anyone help on this.
The solution suggested by Emizen Tech works fine and helps me out to resolve the same issue in my site.
However, it only requires mode to be set to the developer.
In order to change the mode, here is the command:
bin/magento deploy:mode:set developer
you can just write css/js for theme in the app/design same folder
to reflect the changes just remove that deployed file in pub/static folder
Magento2 will auto create the missing/deleted static files
Make sure that pub/static/.htaccess should be there for auto generation of Static Files.
as I can See you have removed the all files and folder into pub/staic folder
copy this .htaccess file form Magento's GIT Repo. : https://github.com/magento/magento2/blob/develop/pub/static/.htaccess
Easy way to directly change in pub/static folder and then it complete put this change in app/design folder that make it faster.

there has been an error processing your request magento 1.7

There has been an error processing your request magento 1.7
Exception printing is disabled by default for security reasons.
Error log record number: 1116398732
Someone has a solution for this error? Please solve my problem
report number represent specific files in var/report folder in magento root
open var/report/ in your magento root dir,
open file called same as your report number , in this case: '1116398732'
paste contents here and we will proceed with finding out what was wrong
You can check the report by going to /var/report
Usually it occurs because of uncleared cache. Just go to /var/cache and delete all the files in cache folder. Refresh the page, it should work.
There are three simple steps to resolve this issue:
1- create tmp directory in your magento site
2- go to magento site/errors directory and update local.xml.sample to local.xml
3- go to magento site/lib/Zend/Cache/Backend/File.php and replace 'cache_dir' => null, to 'cache_dir' => 'tmp',
NOTE:tmp directory permission should be #777
Delete the generated/code directory rm -rf generated/code
Then run
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
chmo -R 0777 var/ pub/ generated/
Now try to run the site, it should be perfect now. Cheers