cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3 issue on live server

SOLVED
Highlighted

Magento 2.3 issue on live server

Hi guys,

I set up my magento 2.3 on localhost via Xampp and all working perfectly.

I transferred magento folder and imported the database on server phpmyadmin.

I changed The core_config_data base URL and entered the env.php informations correctly.

 

When I google the store address in browser, it redirects me to Localhost (127.0.0.1).

If I clean the Var/cache folder, I can finally access to the live store, but all CMS seems to be down and the store frontend aspect completly destroyed.

 

Any solution for this issue ? is it a matter of htaccess ? Why does the store design get down each time I clear the var/cache folder ? Thank you for your advices.

7 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted

Re: Magento 2.3 issue on live server

@jean _bertrand 

 

A server can use different PHP versions for the command line and for webserver.

Please ensure you have the proper PHP versions for the command line.

You can do it by executing the php -v command from the Magento 2 root folder.

 

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

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

View solution in original post

Highlighted

Re: Magento 2.3 issue on live server

php 4.4.9

and my php server is 7.3

View solution in original post

Highlighted

Re: Magento 2.3 issue on live server

@jean _bertrand 

 

Can you try with php 7.2 once.

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

View solution in original post

Highlighted

Re: Magento 2.3 issue on live server

I tried, but still same redirection to localhost and same error on ssh command.

View solution in original post

Highlighted

Re: Magento 2.3 issue on live server

ok, will try... do I have to change something in .htaccess too ?

View solution in original post

Highlighted

Re: Magento 2.3 issue on live server

@jean _bertrand 

 

No nothing has to change in .htaccess. Did you added any local url? if not then no need to change

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

View solution in original post

Highlighted

Re: Magento 2.3 issue on live server

Please do changes in db table core_config_data to remove version from css:

 

insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);

and run below query:

php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Manish Mittal
https://www.manishmittal.com/

View solution in original post

19 REPLIES 19
Highlighted

Re: Magento 2.3 issue on live server

Hello @jean _bertrand 

 

Please check if do you have .htaccess or not in root folder and in pub folder.

Then give permission to folders:

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

run below commands:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

 

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

Re: Magento 2.3 issue on live server

Hello Manish,

 

Yes I have a .htaccess and a .htaccess.sample in root directory.

I gave permission to Pub and Var folders.

 

Once I run the command : php bin/magento setup:di:compile, I have a warning message telling the folder "not empty". If I continue, the frontend and admin get down with an error message... Whaooo !

 

I use ssh Mobalxterm.

 

Highlighted

Re: Magento 2.3 issue on live server

@jean _bertrand 

 

Remove content of generated/code/* folder then run again command.

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

Re: Magento 2.3 issue on live server

Could you give me the complete path to "generated/code" folder ? 

Highlighted

Re: Magento 2.3 issue on live server

@jean _bertrand 

 

On Magento root folder

rm -rf generated/code/*

 

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

Re: Magento 2.3 issue on live server

@jean _bertrand 

 

Please check this document for more reference: 

 

https://devdocs.magento.com/guides/v2.4/howdoi/php/php_clear-dirs.html

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

Re: Magento 2.3 issue on live server

Thank you Manish,

 

Unfortunately, the commands php bin/magento setup:upgrade, shows a syntax error on my ssh.

May I run these commands on localhosts and then transfer the store on live server ?

 

But each time I run the command : php bin/magento setup:di:compile, the site gets down even in localhost... Do you have an idea about this issue ?

 

 

Highlighted

Re: Magento 2.3 issue on live server

@jean _bertrand 

 

Not recommended that, later you has to run all these commands on server only so don't try any shortcuts.

 

I hope you will understand. Thanks

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

Re: Magento 2.3 issue on live server

Ok, so on live server I run these commands in root directory right ? So why do I get syntax error ?