cancel
Showing results for 
Search instead for 
Did you mean: 

Local Site redirects to live site

Local Site redirects to live site

I installed a live site in my local machine after downloading from Server. But when I am trying to browse site locally it is redirecting to Live Site.

What I did so far.
1.  Put right Database name in `.env` file like below.
```

'db' => [
'table_prefix' => '',
'connection' => [
'default' => [
'host' => 'localhost',
'dbname' => 'ashrafvai',
'username' => 'root',
'password' => 'root',
'active' => '1',
'driver_options' => [

]
]
]
],

```
2.  I changed web/unsecure/base_url and web/secure/base_url at core_config_data table in Database.

3.  I deleted /var/cache from Magento root.

4. I am using incognito window of FireFox.

5. I put incorrect details in `.env` file and cleared the cache. I saw error.

6. I put file permission of the Magento folder 777.

7. I am using Linux Mint 19.1 as OS.


 

15 REPLIES 15

Re: Local Site redirects to live site

Hello @foysal 

 

Please run all the commands of the Magento.

 

Setup upgrade
deploy code
indexer re-index
cache cleen

 

 

by this, you get a solution.

 

If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.

Re: Local Site redirects to live site

Thanks @dipmegpro .

Still I can't browse the site.

cant.png

 

 

 

Re: Local Site redirects to live site

Hello @foysal 

 

Please send me the Image as the link. I can't see the image.

Re: Local Site redirects to live site

@dipmegprohere is the link.

Re: Local Site redirects to live site

Hello @foysal 

 

Please check the server which you are using. I assume that the Apache server.

The Apache server is not running so please check the status of the server.

 

If you are using any other server then please check that server status and make the status run.

 

If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.

 

Re: Local Site redirects to live site

Thanks @dipmegpro . I found below error in my `error.log` file of `/var/log/apache2/`.


```

PHP Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: /usr/lib/php/20180731/gd2 (/usr/lib/php/20180731/gd2: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/gd2.so (/usr/lib/php/20180731/gd2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20180731/mysqli (/usr/lib/php/20180731/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mysqli.so (/usr/lib/php/20180731/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20180731/pdo_mysql (/usr/lib/php/20180731/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_mysql.so (/usr/lib/php/20180731/pdo_mysql.so: undefined symbol: mysqlnd_allocator)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xmlrpc' (tried: /usr/lib/php/20180731/xmlrpc (/usr/lib/php/20180731/xmlrpc: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/xmlrpc.so (/usr/lib/php/20180731/xmlrpc.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xsl' (tried: /usr/lib/php/20180731/xsl (/usr/lib/php/20180731/xsl: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/xsl.so (/usr/lib/php/20180731/xsl.so: undefined symbol: dom_node_class_entry)) in Unknown on line 0
PHP Warning: Module 'bz2' already loaded in Unknown on line 0
PHP Warning: Module 'curl' already loaded in Unknown on line 0
PHP Warning: Module 'exif' already loaded in Unknown on line 0
PHP Warning: Module 'fileinfo' already loaded in Unknown on line 0
PHP Warning: Module 'gettext' already loaded in Unknown on line 0
PHP Warning: Module 'intl' already loaded in Unknown on line 0
PHP Warning: Module 'mbstring' already loaded in Unknown on line 0
PHP Warning: Module 'soap' already loaded in Unknown on line 0
PHP Warning: Module 'sockets' already loaded in Unknown on line 0
[Fri Dec 10 07:41:58.569063 2021] [mpm_prefork:notice] [pid 1914] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Dec 10 07:41:58.569143 2021] [core:notice] [pid 1914] AH00094: Command line: '/usr/sbin/apache2'

```


Could you please help me in this regard ? Still I can't see the Magento 2 Store.

Re: Local Site redirects to live site

@dipmegpro 

Here is my `php.ini` file settings.



Re: Local Site redirects to live site

Re: Local Site redirects to live site

Hello @foysal 

 

Please take the knowledge document from this document and re-configured the Apache server.

 

https://devdocs.magento.com/guides/v2.4/install-gde/prereq/apache.html