[resolved] How to Copy WordPress Site to Local Test Server (34 posts)

  1. BobRoberts123
    Posted 3 years ago #

    Notice I use the word "copy" and not "move" - it's only for test purposes and I want the current site to keep running for now.

    I assume I should go into PHPMyAdmin and import the SQL script from the WordPress site. One important question I have, is, before doing this, can I open the *.sql file up in Wordpad and do a global change on the "http://hostingurl.com/customwebsite" and set it to my local site? Will that work? And if it will work, what should I change the URL to in order to get it to work as a local test site? I've unzipped the entire WordPress site into a folder called "C:\Program Files\BitNami WordPress Stack\apps\testapp". Would I, for example, change the *.SQL file for the URL to read "http://localhost/testapp"?

    Keep in mind this is a Windows 7 PC. It currently is running IIS, and if I would type in "http://localhost" into my web browser, then it would run the default site registered under IIS. So I guess that leads to another important question - how is this WordPress site on my PC "registered" to run under the Bitnami Apache web server. I can't find any specific documentation that lists exactly what you have to do to type in a local URL in your browser and have it run your WordPress test site. Thanks in advance for consideration of these issues.

  2. Christi
    Posted 3 years ago #

    Hi Bob,

    You shouldn't have to edit the .SQL file. You will want to change the wp-config.php file of your test copy. Here's the full instructions on making a development copy of your site:


    Hope this helps!

  3. jonradio
    Posted 3 years ago #

  4. BobRoberts123
    Posted 3 years ago #

    Thanks for your replies. I'm having a serious problem with the documentation I've read - it's either not specific enough, too incomplete (lacks context), or doesn't apply to my situation. The "Running_a_Development_Copy..." says, "your develoment site might be "http://localhost/example.com/blog". Not "might" but "must". I must get this WordPress site registered with Apache so that I can at least run it in a browser, but nowhere can I find detailed instructions on how to do that - they aren't there. I installed BitNami and it created a structure "\program files\BitNami WordPress Stack\apps\wordpress" - OR - "\program files\BitNami WordPress Stack\apps\phpmyadmin" For example, the sample WordPress site can be called up in my browser by typing in "http://localhost:81/WordPress

    within "\program files\BitNami\WordPress Stack\apps\..." there are folders called "conf" and "htdocs". The "conf" holds a file called (in the case of the sample WordPress site) wordpress.conf. The "htdocs" folder appears to hold what you would call the WordPress site itself - it has folders called, "wp-admin, wp-content, and wp-includes", as well as other files, such as "wp-config". I have created a folder equivalent to these two containing the test WordPress site (not a blog - a site) I was given in a zip. I have modified everything I can see, including just now, as suggested, modifying the "wp-config.php" with these two lines:
    define('WP_SITEURL', 'http://localhost:81/testsite');

    However, when I type http://localhost:81/testsite into my browser, it still gives a "the webpage cannot be found" error. Though I've created a new database, I haven't yet run the *.sql script I was given to construct the site's database - I had questions about doing that (see prior post) - and I haven't modifed the wp-config.php for the new database name, or login information. Would that explain why the browser can't even begin to find the test site - or is it something else? Somehow I think it's something else.

    Getting back to the "Running_a_Development_Copy...", all it gives is a SELECT statement with no detailed explanation or context - it doesn't say where or how to run it - and even what database to run it on. I checked the *.sql file that constructs the WordPress test database and nowhere in it is it creating a table called "wp_options", so I'm completely stumped at what this "full" documentation is trying to say - except for a general comment about "your development site might be" and a contextless SELECT statement, it says absolutely nothing about how to "run a development copy of WordPress". And the "simple hack" - God am I tired of reading the word "simple" in this documentation - none of the examples even apply to the version of my site - 3.2.1 Besides, I am not trying to "run 2 copies of WordPress" and I am not trying to setup a second "a second blog installation using the same database."

    I'm sure if people were standing over my shoulder they could quickly see my issues and be able to tell me how to get it all to work - but words, either reading them or writing them - people just can't deal with them.

  5. Hi BobRoberts123,
    I personally use wamp but I can give you 10 easy to follow steps as the principle of transfering the site should be the same. Here are the steps to copy a wordpress site to your local installation

    Before we start lets define a few things for this example:

    1. The hosted version address we will refer to as: http://www.hostedversion.com (This is the web address of the hosted wordpress site)
    2. The local version address we will refer to as: http://localhost/testsite (This is the web address of the local host folder you want to transfer your site to)

    STEP 1:
    Copy your files from your webhost to your local server folder.

    STEP 2:
    On your webhost login to phpmyadmin and export your database (By Selecting your database and selecting the export tab and downloading to your computer)

    STEP 3:
    Log into your local phpmyadmin, create a new database and import the sql database into it by selecting the import tab and uploading your file.

    STEP 4:
    Once Uploaded we want to modify the database to reflect the new blog location being on the localhost. So we run the following SQL (Select the SQL tab and paste the following code):

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.hostedversion.com', 'http://localhost/testsite') WHERE option_name = 'home' OR option_name = 'siteurl';

    STEP 5:
    We now want to fix the urls of posts and pages. So we run the following SQL:

    UPDATE wp_posts SET guid = replace(guid, 'http://www.hostedversion.com','http://localhost/testsite');

    STEP 6:
    If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. So we run the following SQL to fix this issue:

    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.hostedversion.com', 'http://localhost/testsite');

    STEP 7:
    We want to now modify our wp-config.php file in our local server. Honestly, the easiest way to do this is to delete the wp-config.php file in your local server and then visit http://localhost/testsite in a browser.

    STEP 8:
    With the dialog message that comes up click the 'Create a Configuration File' button. Then click the 'Lets Go' button on the next screen.

    STEP 9:
    Fill in all of the fields:
    Database Name: This is the name of the database in your local phpmyadmin
    Username: This is your phpmyadmin username (usually root)
    Password: This is your phpmyadmin username's password
    Database Host: This is usually localhost
    Database Prefix: normally is wp_ unless someone has changed it manually.

    STEP 10:
    Click Submit, the wp-config file will be created and everything should work on the local host.

    I hope this helps.


  6. BobRoberts123
    Posted 3 years ago #

    Sunny, thank you for your response - I feel I'm finally getting somewhere. Step 1 and 2 have effectively been done - and I assume that it doesn't matter where I put the files (step 1), though as I explained I created a folder called "testsite" below the "C:\Program Files\BitNami WordPress Stack\apps" folder that BitNami created. Is that ok?

    I was able to run step 3 without an error, a definite sign of progress. However, I have a question about your advice on steps 4, 5, and 6. For my example, I have called my site "testsite" but that isn't what it's really called. Let's say it's called "wordpresssite". What I want to point out is that in the *.sql file given to me that was exported from the actual site, this string of characters appears: "http://www.hostedversion.com/wordpresssite". And on my local test server I have downloaded the files to "C:\Program Files\BitNami WordPress Stack\apps\wordpresssite". So I'm not sure what to put in the SQL code for, let's say, step 4. Keep in mind I think my local URL is "http://localhost:81".

    Following your instructions literally, the UPDATE statement would read ...replace(option_value, 'http://www.hostedversion.com', 'http://localhost:81/wordpresssite') WHERE..." But that would yield a URL of "http://localhost:81/wordpresssite/wordpresssite". The name of the site would be doubled. Are you sure it shouldn't be: ...replace(option_value, 'http://www.hostedversion.com', 'http://localhost:81') WHERE..." It's important that I know which it should be, since I don't think I should continue beyond this point until I find out.

    Also, as I mentioned earlier, there does not appear to be a "wp_options" table in the database I created and imported the *.sql file into. There is, howerver, a "wordpresssite_options" table. Should I use that name instead of "wp_options" in your instructions 4 - 6?

  7. Hi BobRoberts123,
    Based on what you have just told me here are some amendments to the dteps above.

    NEW STEP 4:
    Once Uploaded we want to modify the database to reflect the new blog location being on the localhost. So we run the following SQL (Select the SQL tab and paste the following code):

    UPDATE wordpresssite_options SET option_value = replace(option_value, 'http://www.hostedversion.com/wordpresssite', 'http://localhost:81/wordpresssite') WHERE option_name = 'home' OR option_name = 'siteurl';

    NEW STEP 5:
    We now want to fix the urls of posts and pages. So we run the following SQL:

    UPDATE wordpresssite_posts SET guid = replace(guid, 'http://www.hostedversion.com/wordpresssite','http://localhost:81/wordpresssite');

    NEW STEP 6:
    If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. So we run the following SQL to fix this issue:

    UPDATE wordpresssite_posts SET post_content = replace(post_content, 'http://www.hostedversion.com/wordpresssite', 'http://localhost:81/wordpresssite');

    NEW STEP 7:
    We want to now modify our wp-config.php file in our local server. Honestly, the easiest way to do this is to delete the wp-config.php file in your local server and then visit http://localhost:81/wordpresssite in a browser.

    Then just cary on with the steps described above. The bitnami set up seems ok. The reason that you cant find the wp_options table is because the database prefix 'wp_' which is normally the default has been changed by the person that had set up this site (which is good for security purposes). But just follow the steps and you should be good!


  8. BobRoberts123
    Posted 3 years ago #

    Thank you so much, Sunny, I was able to run steps 4 - 6, so that is more progress. However, trying to run step 7, I'm back to the orignal and fundamental problem I originally posted about. When I type in "http://localhost:81/wordpressite" in a browser, it says "Not Found - the requested URL was not found on this server". Keep in mind that the real folder the wordpress site resides in is "C:\Program Files\BitNami WordPress Stack\apps\wordpresssite\htdocs" This is where the wp-admin, wp-content, and wp-includes folders are, as well as the wp-config.php file before I deleted it.

    I'm familiar with Windows IIS, and you always have to "register" your site by associating the actual folder where the site exists (physical path) with the URL localhost/sitename (virtual path). But that's a bit of information that's missing here - how does my browser know when I type in "http://localhost:81/wordpressite" that the site is actually located in "C:\Program Files\BitNami WordPress Stack\apps\wordpresssite\htdocs"?

    Keep in mind I put it there because there was an example "wordpress" site that BitNami installed already under apps with the same structure, so I tried to duplicate what they're doing. Besides, all the general instructions I've read make it seem that it doesn't matter where you put the wordpress site - somehow it's magically (simply, easily) supposed to be found by the browser.

    I want to mention that if I type in "http://localhost:81" into the browser, it brings up the BitNami Welcome! - Access BitNami WordPress Stack page, which appears to actually be located here: C:\Program Files\BitNami WordPress Stack\apps\wordpress\htdocs

  9. I dont know if it was a typo in your last post: http://localhost:81/wordpressite You seemed to have missed an extra s out of the url. Try visiting this url: http://localhost:81/wordpresssite and let me know what happens.

  10. Also in answer to your question Bitnami automatically creates the association to localhost for you so as long as you set up your new stack and place the files in the htdocs folder you should be good. You dont need to worry about creating any associations. Hope that helps


  11. BobRoberts123
    Posted 3 years ago #

    No, I had just neglected to type in the third "s". When I in fact go to http://localhost:81/wordpresssite, I get "The webpage cannot be found".

    I might add that in the sample wordpress site that installs with Bitnami, along with the "htdocs" folder there is also a "conf" folder, which contains a file called wordpress.conf. It contains:
    Alias /wordpress/ "C:/Program Files/BitNami WordPress Stack/apps/wordpress/htdocs/"
    Alias /wordpress "C:/Program Files/BitNami WordPress Stack/apps/wordpress/htdocs"

    <Directory "C:/Program Files/BitNami WordPress Stack/apps/wordpress/htdocs">
    Options Indexes MultiViews +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]

    # Uncomment the following lines to see your application in the root
    # of your URL. This is not compatible with more than one application.
    #RewriteEngine On
    #RewriteRule ^/$ /wordpress/ [PT]
    When I created the wordpresssite and put it under "C:\Program Files\BitNami WordPress Stack\apps", and I copied the contents of the exported zip into the "htdocs" folder. And I also created the above-menioned conf folder. I copied the wordpress.conf file in, renamed it to wordpresssite.conf, and then modified it to look like this:
    Alias /wordpresssite/ "C:/Program Files/BitNami WordPress Stack/apps/wordpresssite/htdocs/"
    Alias /wordpresssite "C:/Program Files/BitNami WordPress Stack/apps/wordpresssite/htdocs"

    <Directory "C:/Program Files/BitNami WordPress Stack/apps/wordpresssite/htdocs">
    Options Indexes MultiViews +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    RewriteEngine On
    RewriteBase /wordpresssite/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpresssite/index.php [L]

    # Uncomment the following lines to see your application in the root
    # of your URL. This is not compatible with more than one application.
    #RewriteEngine On
    #RewriteRule ^/$ /wordpresssite/ [PT]
    But, unfortunately that does not get rid of the page not found. I even tried deleting the conf folder, and it had no effect on the error.

    I did try something that had an interesting result. I deleted the contents of ""C:/Program Files/BitNami WordPress Stack/apps/wordpress/htdocs/"
    and replaced it with the contents of "C:/Program Files/BitNami WordPress Stack/apps/wordpresssite/htdocs/"

    I then typed http://localhost:81/wordpress into the IE9 browser.

    The browser then displayed a page that said: "There doesn't seem to be a wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.

    Create a Configuration File" I filled out the form with the new database information and hit Submit.

    A tab then opened up in the brower called "Localhost" and the progress indicator just kept turning. If I hover the mouse over the tab, the tooltip says, "http://localhost:81/wordpress/wp-admin/setup-config.php?step=1"

    The wp-config.php never gets created.

    If I restore the wp-config.php file back and edit it manually for the database information, and type in "http://localhost:81/wordpress" in the browser, it just gets hung up trying to open it, but doesn't open anything up.

  12. BobRoberts123
    Posted 3 years ago #

    Just to reiterate what I've done lately, I copied the contents of C:\Program Files\BitNami WordPress Stack\apps\wordpresssite\htdocs" into C:\Program Files\BitNami WordPress Stack\apps\wordpress\htdocs". Keep in mind that http://localhost:81/wordpress was working, displaying their example site. I then ran the three scripts (steps 4, 5, and 6)in PHPMyAdmin on the database associated with the site, for example:

    UPDATE wordpresssite_options SET option_value = replace(option_value, 'http://localhost:81/wordpresssite', 'http://localhost:81/wordpress') WHERE option_name = 'home' OR option_name = 'siteurl';

    After doing that, when I type in "http://localhost:81/wordpress" in Firefox, it shows a tab up at the top saying "Connecting..." and below shows the message "Waiting for localhost..." But it never opens up any page - the page remains blank.

    Then I double-checked the wp-config.php file, and noticed this line:
    define('DB_HOST', 'localhost:81');

    I decided to change it to: define('DB_HOST', 'localhost');

    removing the port, reasoning that it was connecting not to the web server but to the database, and maybe it didn't need port 81. I was right - and it now opens up the test wordpress site, but it doesn't look exactly like the current production one, almost as if the style sheet is not the same. I'll try to reverse it all out and see if I can get the test site to function in its own folder structure.

    Well, I was not able to get the site to function within a new, independent folder structure in BitNami - it acts like it can't find the localhost:81 URL. I can get it to work by cannibalizing the existing wordpress application and folder structure installed under BitNami.

  13. Hi BobRoberts123,
    Although you have the site partly functioning, you seem to be having alot of trouble with bitnami and also its not the ideal set up as you may want to set up multiple websites on localhost at the same time. I recommend uninstalling everything i.e bitnami and iis, downloading and installing wamp http://www.wampserver.com/en/? and following my initial steps from 1 -10.

    It is so easy to create a new site in wamp. All you have to is go to C:\wamp\www and create a new subfolder which will be a whole new site. Then just follow my steps from 1-10 and you will be good! Let me know if you need further assistance.


  14. BobRoberts123
    Posted 3 years ago #

    Thanks, Sunny, I will try wamp. Not sure if I want to uninstall IIS though - I'll see if I can get by with running them both.

  15. BobRoberts123
    Posted 3 years ago #

    Problem. After installing wamp and going into phpMyAdmin, I noticed that it didn't ask for a username and password, even to create the wordpress mySQL database, which I was able to do. So then what am I supposed to put for the database username and password in the wp-config.php file? In order to give it something, I entered this in phpMyAdmin:

    GRANT ALL PRIVILEGES ON newwordpressdb.* TO 'root'@'localhost' IDENTIFIED BY 'pass12345';

    Subsequently any time I try to run the phyMyAdmin or MySQL console, it gives this error:

    "#1045 - Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server."

    In the MySQL console, it doesn't even give you the opportunity to put in a password - only a username, and so doesn't let you in there either. And, of course, in phpMyAdmin, it doesn't ask for either a username or password.

  16. BobRoberts123
    Posted 3 years ago #

    Uninstalled and reinstalled Wamp, and still getting the above error trying to go into MySQL.

  17. Hi BobRoberts123,
    Follow this article to reset you root password
    (Quick note, when logging into the mysql console the password will either be the one you specified above or just enter nothing at all and hit enter, as wamp doesn't give the root user a password by default)

    Once you regain access to phpmyadmin just create a new database import that wordpress site like I described in the posts above and in your wp-config file the username is root and the password is whatever you assign it.

    Give me a shout if you need any further help.

  18. BobRoberts123
    Posted 3 years ago #

    Thanks Sunny, and that is the first half of it, but I had to modify the C:\wamp\apps\phpmyadmin3.4.5\config.inc.php file for the following parameters:

    $cfg['Servers'][$i]['password'] = 'yourpassword';
    $cfg['Servers'][$i]['AllowNoPassword'] = false;

    But even after doing that, the WAMPSERVER phpMyAdmin still won't let me in. But fortunately, if I type "http://localhost:81/phpMyAdmin" in Firefox, that lets me in.

    Well, at least in Wamp it lets me create a unique folder structure for my WordPress site, but it still displays the site in "static-html" mode - it does not look like the production WordPress site. The basic functionality is there, but it looks quite different. To reiterate, it has a folder structure of "C:\wamp\www\newwordpresssite\wp-content\plugins\really-static\static" that contains index.html files that are the ones displayed for all the pages. I presume that these display instead of the index.php files. Obviously, something somewhere is triggering or toggling this alternate display mode.

    I went to "install" wordpress-3.3.1, and was surprised (or perhaps not so surprised) that all it did was create a WordPress folder structure - it's not an actual install at all. Yet I had asked someone on the forum if it needed to be installed prior to my unzipping the exported site, and someone told me "yes". So the lack of a true WordPress installation wouldn't account for the site displaying in "static-html" mode.

  19. Hi BobRoberts123,
    Here are a couple of points to guide you in the right direction

    1. You need to disable your iis as http://localhost:81/phpMyAdmin is not the wamp phpmyadmin and is irrelevant to your wamp installation.
    2. Restart your wamp server after making these changes and try phpmyadmin again (Click the wamp icon in the windows taskbar - near the clock and select the 'restart all services' menu option.
    3. There is no alternative mode being triggered it is just because wordpress is not setup properly and as there is no database connection that is why it is displaying the file/folder structure in your site.
    4. If you are copying just the theme folder in wordpress then you need to install wordpress prior to installing the theme. But from what you have told me it seems like you are copying over the full site which includes the wordpress core files, so you don't need to worry about all that and just follow the ten steps I listed above once your phpmyadmin is working.
    5. What exactly is the error that you are getting when trying to access phpmyadmin?
    6. Also let me know when you are at a stage where you have got phpmyadmin working and you have imported your database and I will gude you from there. I think all of these forums/other peoples comments etc are just confusing you and making you think that this is a bigger task then it actually is. I was daunted by this at first but trust me once you learn how to do it once you will be setting up a new wordpress site in less than 5 mins.

    Hope that helps

  20. BobRoberts123
    Posted 3 years ago #

    Yes, I'm using the full site that I've unzipped into the C:\wamp\www\newwordpresssite folder. I did stop the IIS services, but keep in mind that I installed Wamp to user localhost:81, and I changed the configuration files to reflect that, and that seems to work. I had rebooted my PC, and now I can run phpMyAdmin from the Wamp menu group. The WordPress database "newwordpresssitedb" I had created before is still there. The tables have names such as newwordpresssitedb_options, and the columns reflect the URL change in the 3 SQL queries I ran before. This is the first query:

    UPDATE newwordpressite_options SET option_value = replace(option_value, 'http://currentsite.com/newwordpresssite', 'http://localhost:81/newwordpresssite') WHERE option_name = 'home' OR option_name = 'siteurl';

    Could the problem be that phpMyAdmin is not asking for a login, so it isn't clear what user is creating the database, loading it, and changing it, and if that user matches the one in the wp-config.php file? wp-config.php:

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'newwordpresssitedb');

    /** MySQL database username */
    define('DB_USER', 'root');

    /** MySQL database password */
    define('DB_PASSWORD', 'wp123456');

    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    One question I have is the "MySQL hostname" above. I assume it should not be "localhost:81", since it is referring to the MySQL server and not the web server.

    I think I might have run this in the MySQL console:

    UPDATE mysql.user
    ->SET Password=PASSWORD("wp123456")
    ->WHERE User="root";

    And I also made this change:
    $cfg['Servers'][$i]['password'] = 'wp123456';
    $cfg['Servers'][$i]['AllowNoPassword'] = false;

    Is there any way to tell if the WordPress site is able to login to the newwordpresssitedb database? Or to simplify the login so it is more likely to work?

  21. Hi,
    The fact that phpmyadmin is not asking you for a username doesn't matter as far as it is concerned 'root' is definately the user. You should have just installed it on localhost. Do this, delete the wp-config.php file again. Visit http://localhost:81/newwordpresssite in your browser follow the steps, but this time when it asks you for the MYSQL Database Password just leave it blank and tell me what happens. WordPress should tell you whether it was able to connect to the server. If it was not able to connect to the server try the following options in turn to figure out what is going on: 1. Change the hostname to localhost:81 2. Put the existing password that you have set in the password field and leave the hostname as localhost 3. Change the hostname to localhost:81 and put in the password you have specified above.
    Again your life would be alot simpler if you just follow the recommended wamp setup on localhost and follow the steps I outlined before. But give this a shot and give me a shout if you need any further assisstance.


  22. BobRoberts123
    Posted 3 years ago #

    Hold off on this issue - I've compared the pages of the production on-line site and the one I'm displaying from the zip file, and I have found slight differences in wording. So what I could be looking at is an old version of the WordPress site - though I had brought this to the attention of the site administrator weeks ago with full screen shots, he says the zip reflects the current site.

    In addition, there is a folder that seems to contain the "static-html" pages:


    Well, I deleted this entire folder, and it didn't affect the way the site looks!

  23. Hi BobRoberts123,
    The 'really-static' plugin is not included with the wordpress core files, it is a caching plugin that produces static html pages of your wordpress blog so that they can render faster (instead of having wordpress dynamically construct the pages everytime it is requested). This may be a reason why you are facing so much difficulty but I recommend disabling the plugin, getting the wordpress site to function as normal and then re-enabling the plugin once it is on the production server. Again just give me a shout if you need any further assistance.


  24. BobRoberts123
    Posted 3 years ago #

    Well, I do need to know how to disable the plugin. I've found all sorts of vague references to doing that, but no specific instructions. Also, I'm puzzled about something - how can the Really-Static plugin be enabled if I can delete the ...\plugins\really-static folder structure and have the WordPress site run the same, without an error? And if it's not enabled, why do I have to concern myself with deleting it?

    I'll go ahead and post the results of your suggested tests above in trying to determine if the WordPress site can connect to the database:

    Sunny, I know you suggest that the reason this WordPress site is running in "static-html" mode is because, "3. There is no alternative mode being triggered it is just because wordpress is not setup properly and as there is no database connection that is why it is displaying the file/folder structure in your site."

    But I tried a little test - I modified the wp-config.php and put in an invalid database password. If the site is displaying in static-html because it can't log in to the database, then that would not have any effect - it would look the same. But when I did that, the site gives a "the website cannot display the page" error.

    I decided to create a new database in phpMyAdmin (wpdb) and I remembered that before I had used utf8_unicode_ci, and so I made sure it said utf8_general_ci. I also had specified MYSQL323 in the "Format-specific options", and this time I left it as "None". I also used the "Privileges" tab in phpMyAdmin to setup a new user with an auto-generated password.

    I followed your suggested tests above, deleting the wp-config.php, and want to comment that of course changing "Database Host" to "localhost:81" is not going to work, because only the web server is set to "localhost:81" - the database is at "localhost". So, if I change the database server to "localhost:81", with or without a password, it does nothing, trying to run "localhost" in the browser tab above.

    If I leave the Datbase Host at "localhost", and either blank out the password or put in a wrong one, I get:

    "Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server

    at localhost. This could mean your host's database server is down.
    •Are you sure you have the correct username and password?
    •Are you sure that you have typed the correct hostname?
    •Are you sure that the database server is running?"

    And if I use an old database with an old user, I get:

    Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the newwordpressitedb

    •Are you sure it exists?
    •Does the user pauser have permission to use the newwordpresssitedb database?
    •On some systems the name of your database is prefixed with your username, so it would be like username_newwordpresssitedb. Could that be the problem?"

    However if I use either an old database, new user and new auto-generated password or a new database, new user and new auto-generated password, I get this:

    "All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…Run the Install"

    When I click the Run the Install button, it then it tells me WordPress is already installed: "Already Installed

    You appear to have already installed WordPress. To reinstall please clear your old database tables first.

    Log In"

    But the fact is, the site still displays different than the production one on the web, which, as I mention above, causes me to question whether I was given the current version of the site.

  25. BobRoberts123
    Posted 3 years ago #

    I finally determined that it is indeed a different site - but learned a lot in finding that out. Thanks for your help.

  26. emaravelia
    Posted 3 years ago #

    Hi Sunny,

    I followed your instructions and managed to set up a test site locally. Although I can login to the Dashboard it doesn´t let me see the actual site.
    my localhost i actually localhost:8666 and I did all the changes accordingly but when I´m in the dashboard and try to visualize a post or page it says

    Object not found!

    The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

    If you think this is a server error, please contact the webmaster.

    Any ideas what it might be?

  27. emaravelia
    Posted 3 years ago #

    Well it seems I found the solution. I have named the new site exactly like the original so i just changed the name and everything was perfectly.

    Thanks for the great step by step tutorial.

  28. Hi emaravella,
    My pleasure, I am glad you resolved your issue. If you need any help give me a shout :)


  29. jawiseman@yahoo.com
    Posted 3 years ago #

    My site http://www.immersonal.com is working fine at its web host (godaddy), but when I bring it down to localhost (WAMP) I am getting tons of error messages such as the following, with call stack information following each error message:

    "Strict standards: Non-static method truethemes_accordion_class::init() should not be called statically in C:\wamp\www\imm_dev\wp-content\themes\Karma\truethemes_framework\global\shortcodes.php on line 692"

    "Strict standards: Non-static method W3_Request::get_boolean() should not be called statically, assuming $this from incompatible context in C:\wamp\www\imm_dev\wp-content\plugins\w3-total-cache\lib\W3\Plugin\TotalCache.php on line 355"

    "Strict standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::nav_menu() should not be called statically in C:\wamp\www\imm_dev\wp-includes\plugin.php on line 170"

    There are many of these throughout the site, interspersed through the content of the page.

    I assume this is a developer tool within WAMP that perhaps I can turn off to work on the page?

    Any help would be appreciated.

  30. esmi
    Forum Moderator
    Posted 3 years ago #

    Please post your own topic.

Topic Closed

This topic has been closed to new replies.

About this Topic