cancel
Showing results for 
Search instead for 
Did you mean: 

Problem after changing hosting

SOLVED

Problem after changing hosting

Hello, after moving the files and connecting the database to the new server does not show me the theme correctly. The problem occurs on the home page and in the admin panel. I was cleaning the var / cache and var / page_cache folders, but it did not give any result. I also changed the address in the core_config_data database. How can I fix it?
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Problem after changing hosting

@ann_mar  You can ask your hosting provider to make those updates for you. As I said in one of the previous comment you can have different PHP version for Web and command line. This need to be fixed to make the thing working for you.

 

You can also try command like below. May work otherwise you have to get the version for CLI fixed.

 

/usr/bin/php7 bin/magento cache:clean

or

/usr/bin/php70 bin/magento cache:clean

 

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

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

View solution in original post

14 REPLIES 14

Re: Problem after changing hosting

Hello @ann_mar 

 

Have you run the static deploy command again ? after moving on the new server.

 

Run below commands in sequence :

 

php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

It might works !

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: Problem after changing hosting

Hello @ann_mar ,

 

Please run below command to generate static content deploy

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
chmod -Rf 777 pub/ var/ generated/
php bin/magento cache:clean

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Problem after changing hosting

Just tried these commands but always had this error: http://i64.tinypic.com/2z7lsg2.jpg

Edit:
and now doesn't even work, only this message:
An error has happened during application run. See exception log for details.

Re: Problem after changing hosting

Hi @ann_mar 

 

Ok - so can you please go to the var/log and you will find the exception.log file over there.

 

Open that file and post the log over here, so its help us to troubleshoot the issue.

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: Problem after changing hosting

Now I can’t send the whole file now because it’s really hard on the phone, but this is the first line Smiley Wink

[2019-02-08 14:08:44] main.CRITICAL: Magento\Framework\Exception\LocalizedException: Coś się zepsuło podczas zapisywania plików. in /home/greg/domains/mgreg.net/public_html/bk/vendor/magento/module-catalog/Model/ImageUploader.php:205

I saw magento try use the old address/hosting (mgreg.net) and the rest of this file had the same error but in different files.

Re: Problem after changing hosting

Hi @ann_mar 

 

It looks like you have localized exception error, it is generally coming from generation directory !

 

I would suggest you to run below commands in sequence :

 

rm -rf generated
rm -rf var/cache
rm -rf var/page_cache
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

Try it, it will works !

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: Problem after changing hosting

Still have this error when I try use any of php bin/magento commands:

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/annmar/websites/b/b/vendor/magento/framework/App/Bootstrap.php on line 411

Re: Problem after changing hosting

Last entry in the file:

[2019-04-04 14:24:00] main.CRITICAL: Exception: Warning: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' (this will throw an Error in a future version of PHP) in /home/annmar/websites/www/bg/vendor/magento/framework/Encryption/Encryptor.php on line 397 in /home/annmar/websites/www/bg/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 /home/annmar/websites/www/bg/vendor/magento/framework/Encryption/Encryptor.php(397): Magento\Framework\App\ErrorHandler->handler(2, 'Use of undefine...', '/home/annmar/we...', 397, Array)
#1 /home/annmar/websites/www/bg/vendor/magento/framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('002b0efcc538c21...', 0, false)
#2 /home/annmar/websites/www/bg/vendor/magento/module-config/Model/Config/Backend/Encrypted.php(109): Magento\Framework\Encryption\Encryptor->decrypt('PayPal')
#3 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(88): Magento\Config\Model\Config\Backend\Encrypted->processValue('PayPal')
#4 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(106): Magento\Framework\App\Config\MetadataConfigTypeProcessor->processScopeData(Array)
#5 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config/PostProcessorComposite.php(34): Magento\Framework\App\Config\MetadataConfigTypeProcessor->process(Array)
#6 /home/annmar/websites/www/bg/var/generation/Magento/Framework/App/Config/PostProcessorComposite/Proxy.php(95): Magento\Framework\App\Config\PostProcessorComposite->process(Array)
#7 /home/annmar/websites/www/bg/vendor/magento/module-config/App/Config/Type/System.php(166): Magento\Framework\App\Config\PostProcessorComposite\Proxy->process(Array)
#8 /home/annmar/websites/www/bg/vendor/magento/module-config/App/Config/Type/System.php(112): Magento\Config\App\Config\Type\System->loadConfig()
#9 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...')
#10 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...')
#11 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use_...', 'default', NULL)
#12 /home/annmar/websites/www/bg/vendor/magento/module-store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...')
#13 /home/annmar/websites/www/bg/vendor/magento/framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply()
#14 /home/annmar/websites/www/bg/vendor/magento/framework/Interception/Interceptor.php(123): Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor))
#15 /home/annmar/websites/www/bg/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(26): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array)
#16 /home/annmar/websites/www/bg/pub/errors/report.php(15): Magento\Framework\App\Response\Http\Interceptor->sendResponse()
#17 /home/annmar/websites/www/bg/vendor/magento/framework/App/Http.php(324): require('/home/annmar/we...')
#18 /home/annmar/websites/www/bg/vendor/magento/framework/App/Http.php(160): Magento\Framework\App\Http->handleGenericReport(Object(Magento\Framework\App\Bootstrap), Object(Exception))
#19 /home/annmar/websites/www/bg/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Exception))
#20 /home/annmar/websites/www/bg/index.php(43): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#21 {main} [] []
[2019-04-04 14:24:00] main.CRITICAL: Exception: Warning: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' (this will throw an Error in a future version of PHP) in /home/annmar/websites/www/bg/vendor/magento/framework/Encryption/Encryptor.php on line 397 in /home/annmar/websites/www/bg/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 /home/annmar/websites/www/bg/vendor/magento/framework/Encryption/Encryptor.php(397): Magento\Framework\App\ErrorHandler->handler(2, 'Use of undefine...', '/home/annmar/we...', 397, Array)
#1 /home/annmar/websites/www/bg/vendor/magento/framework/Encryption/Encryptor.php(313): Magento\Framework\Encryption\Encryptor->getCrypt('002b0efcc538c21...', 0, false)
#2 /home/annmar/websites/www/bg/vendor/magento/module-config/Model/Config/Backend/Encrypted.php(109): Magento\Framework\Encryption\Encryptor->decrypt('PayPal')
#3 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(88): Magento\Config\Model\Config\Backend\Encrypted->processValue('PayPal')
#4 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(106): Magento\Framework\App\Config\MetadataConfigTypeProcessor->processScopeData(Array)
#5 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config/PostProcessorComposite.php(34): Magento\Framework\App\Config\MetadataConfigTypeProcessor->process(Array)
#6 /home/annmar/websites/www/bg/var/generation/Magento/Framework/App/Config/PostProcessorComposite/Proxy.php(95): Magento\Framework\App\Config\PostProcessorComposite->process(Array)
#7 /home/annmar/websites/www/bg/vendor/magento/module-config/App/Config/Type/System.php(166): Magento\Framework\App\Config\PostProcessorComposite\Proxy->process(Array)
#8 /home/annmar/websites/www/bg/vendor/magento/module-config/App/Config/Type/System.php(112): Magento\Config\App\Config\Type\System->loadConfig()
#9 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...')
#10 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...')
#11 /home/annmar/websites/www/bg/vendor/magento/framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use_...', 'default', NULL)
#12 /home/annmar/websites/www/bg/vendor/magento/module-store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...')
#13 /home/annmar/websites/www/bg/vendor/magento/framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply()
#14 /home/annmar/websites/www/bg/vendor/magento/framework/Interception/Interceptor.php(123): Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor))
#15 /home/annmar/websites/www/bg/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(26): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array)
#16 /home/annmar/websites/www/bg/pub/errors/report.php(15): Magento\Framework\App\Response\Http\Interceptor->sendResponse()
#17 /home/annmar/websites/www/bg/vendor/magento/framework/App/Http.php(324): require('/home/annmar/we...')
#18 /home/annmar/websites/www/bg/vendor/magento/framework/App/Http.php(160): Magento\Framework\App\Http->handleGenericReport(Object(Magento\Framework\App\Bootstrap), Object(Exception))
#19 /home/annmar/websites/www/bg/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Exception))
#20 /home/annmar/websites/www/bg/index.php(43): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#21 {main} [] []

 

 

Any ideas?

Re: Problem after changing hosting

@ann_marSeems like an issue with the server configuration. I would recommend to compare that you have same version of PHP installed as previous server as well as all the PHP modules required are enabled. You can compare the php.ini of both server to find out the same.

 

Another thing to look into is version of PHP for command line. If you are on a server which have multiple PHP version then chances are there that you may be using older version of PHP for command line.

 

Once above issues are fixed then try the different command to remove the cache and deploy static file content as suggested by others.

 

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

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