Wordpress localhost not working [duplicate]

落爺英雄遲暮 提交于 2019-12-08 07:39:25

问题


I am new to wordpress so please assist.

I know there have been some questions regarding this already there but it did not work hence asking for assistance

I have cloned a live repo and saved it in my WAMP www folder which I normally use for other php sites and refer it using localhost/project/ but now when I am trying this it is redirecting to https://localhost/project/

I performed following steps

1) Set up my db connection in wp-config.php

2) added these 2 lines in wp-config

define('WP_HOME','localhost/project');
define('WP_SITEURL','localhost/project');

3) turned WP_CACHE to false in wp-config.php

I don't know what else to do so please assist.


回答1:


If it does not work, you can try using php built-in server. Go to your project root directory and execute the below command in console.

php -S localhost:8000




回答2:


I can mention some basic steps without having much knowledge about your installation,

  1. Go to phpmyadmin, option wp_options, change WP_HOME and WP_SITEURL values, no need to define on wp-config.php

  2. Rename your plugins folder to something like "plugins1" and access admin, if you can access then go straight to update your Permalink.

  3. After updating permalinks rename plugins folder back to plugins then access plugin section on wp-admin.

UPDATE

After migration you are advised to replace all urls through out data base with old url. Please checkout the following plugin, it will surely help you out.

https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Let me know if still finding issue.




回答3:


Its because of plugins that redirect like you may use some security plugin, Please deactivate all plugins ( to deactivate all plugins from database please check this link https://www.templatemonster.com/help/wordpress-disable-plugins-via-database-manual-removal.html )and delete cache folder and change base url from database no need to change config file

You can check base url for database here . url (http://www.inmotionhosting.com/support/website/wordpress/wordpress-changing-the-site-url-and-home-settings) Let me know if it helps

Last this you can try edit config file to show error reporting so that if any error related to custom it will display(Wp-config.php file change this define('WP_DEBUG', true); true to show errors). Thanks



来源:https://stackoverflow.com/questions/47784611/wordpress-localhost-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!