Warning: session_start(): Cannot start session when headers already sent in /home/expertwe/public_html/wp-content/plugins/unyson/framework/includes/hooks.php on line 259
How to Properly set Production Mode and compilation in Magento2 - ExpertWebSolutions

In Magento 2, You do not need to run static:content:deploy command every time when your Magento mode is default or developer, but when you change Magento mode to production at that time Magento will not generate static content file automatically.

So you need to run deploy commands in this sequence..

You can change your Magento mode from developer to production using below command.

php bin/magento deploy:mode:set production --skip-compilation

After running above command your Magento mode will be change from developer to production, then you need to run below commands.

php bin/magento setup:upgrade
php bin/magento setup:di:compile
or php -dmemory_limit=-1 bin/magento setup:di:compile
 php bin/magento cache:clean 
php bin/magento cache:flush 
php bin/magento setup:static-content:deploy -f en_US bg_BG
php -dmemory_limit=-1 bin/magento setup:static-content:deploy -f en_US