Forum Replies Created

Viewing 15 replies - 271 through 285 (of 301 total)
  • If https://localhost/mysiteproject1 and https://localhost/myroject2 are going to be two, new, separate WP sites on your XAMPP localhost, then:

    – create 2 new databases, mysiteproject1 and myproject2
    – create 2 new folders within C:\xampp\htdocs named mysiteproject1 and myproject2
    – copy all the files and folders from the extracted (unZIPped) WP download into each folder (don’t forget that when you extract the WP download, it creates a folder named ‘wordpress’; it’s the contents of this folder that need to be copied to the above new folders)
    – run the install from each, using https://localhost/mysiteproject1 and https://localhost/myroject2

    You can have as many local sites within XAMPP (or any local server) as your hard drive has room for; that is the only limit. And they do not all need to be WP sites either; Drupal, Joomla!, eFront, PrestaShop, etc. will all work as well ??

    Cheers!
    Lyle

    The reason one would want to run multiple WP sites (instances) on a single MySQL database (instance) is that on some hosting plans you are only able to have one MySQL database. Using unique table prefixes for each site is one way to accomplish that.

    So then …

    1. A MySQL ‘instance’ would be a single installation of the MySQL Server whereas a MySQL database ‘instance’ would be a single database within that server.

    2. see the first paragraph ??

    3. A WP ‘instance’ would be a single, unique WP ‘site’ or ‘installation’

    Cheers!
    Lyle

    The siteurl line is the Site one; you will need to use the arrows to move to the next page to see the home field.

    Tools > Export will just export the pages and posts; not really what you would want for a full local version of the live site.

    cPanel is part of (if your host uses it) your hosting account. Who is your site hosted with? HostGator, GoDaddy, BlueHost, etc.? Your hosting account is where you log into to ZIP and download the site files. It is also where you went to export the live site’s database.

    Hi Alice,

    You could try using the Duplicator plugin to move the site:

    https://www.ads-software.com/plugins/duplicator

    Or do it way I do: manually, as you have tried.

    However, I never change the ports nor the document root on MAMP. I really do not know why a lot of tuts say to do so; just complicates things for no apparent reason.

    Here are the steps (using the default MAMP settings for Apache and MySQL ports and the default document root):

    Live Site:

    – export the DB
    – ZIP the contents of the site and download (any host using cPanel has this capability in the File Manager (they call it Compress)

    Local Site:

    – create a new, empty DB using phpMyAdmin
    – use the default DB user for MAMP: root, pwd: root; in other words, just create the DB and not a DB user)
    – import the exported DB .sql file
    – edit the Site and Home fields in the wp-options table with the local URL, eg: if you created a folder in htdocs named mysite then it’s https://localhost:8888/mysite
    – create the mysite (or whatever, but NO SPACES) in Applications/MAMP/htdocs
    – unZIP the site download in this folder; if it creates a new folder within this one when unZIPping, simply move the contents up to mysite
    – using a plain text editor such as the free Text Wrangler (I do not recommend TextEdit as it can mess with the single quotes), change the values of the DB Name (whatever you named it), User (root) and Password (root) in the local version of wp-config.php (which will now be in your mysite folder
    – that will get your local site running with https://localhost:8888/mysite
    – log into the site with https://localhost:8888/mysite/wp-admin and install and run this plugin to update the URLs in the local site:

    https://www.ads-software.com/plugins/better-search-replace

    – the values to use in this example would be:

    Search for: https://www.mysite.com or https://mysite.com
    – note: use the one that you use on the live site

    Replace with: https://localhost:8888/mysite
    – remember to select all the tables and uncheck the Dry Run tick box

    – once that is done, then go to Settings > Permalinks and just click Save (this rebuilds the .htaccess file)

    It sounds like a lot of work, but I just did it now in barely over 6 minutes ??

    Cheers!
    Lyle

    Forum: Fixing WordPress
    In reply to: Numbers or Excel

    @trackrabbit

    Save your Numbers spreadsheet as an Excel file, then install and use this plugin:

    https://www.ads-software.com/plugins/embed-any-document/

    Works like a charm ??

    Cheers!
    Lyle

    @manish96170 – I guess the question then is, why exactly, do you wish to connect a local install to a remote DB?

    If it is just to create/update posts to the site from a local computer without logging on to the remote site, then perhaps you should look into something like Windows Live Writer (Windows) or MarsEdit for the Mac OS.

    These are the two programs that I use to create posts while offline on my own computers. When I do get to where I can be online, I simply connect and publish ??

    This has that added benefit that you always have a saved local copy of your posts ??

    Cheers!
    Lyle

    This is how you connect a local WP install to a remote version’s DB, assuming your remote site is using cPanel.

    – in your remote cPanel, select Remote MySQL from the Databases section
    – enter your local system’s IP address (go to Google and search on My IP) and Save
    – from your cPanel home page, copy your hosting account IP address
    – edit your local wp-config with the DB name, user and password of the remote DB you wish to connect to
    – the value to enter in the local w-config for the MySQL hostname is the IP address of your hosting account that you copied earlier, and it is ONLY the IP address – NO https:// etc.

    Just tested this with a GoDaddy shared Linux plan and a local WP install running in XAMPP on Win 10.

    Cheers!
    Lyle

    Hi ronka,

    What you need to do now is update all the URLs to the local address.

    Install and run this plugin to do so:

    https://www.ads-software.com/plugins/better-search-replace/

    Once you do that, go to Settings > Permalinks and just click Save, which will rebuild your .htaccess file.

    Cheers!
    Lyle

    You will have to increase the value of max_execution_time in your local server’s php.ini file.

    Regarding XAMPP, you will also need to increase the value of upload_max_filesize from the default value of 2M to something like 10M to handle that plugin.

    Don’t forget to restart Apache after making the changes.

    Cheers!
    Lyle

    Glad it worked but I really can’t answer why … perhaps take a look at the phpMyAdmin docs ??

    @bernard46

    Just tried this on my local Windows MAMP and yep, as you are experiencing, get the DB connection error.

    What fixed it? Use local instead of the %

    Additionally, as you may or may not be aware, the user name and password are case-sensitive. Verified by changing Newuser to newuser; connection error ??

    Cheers!
    Lyle

    When you change the URL of your site, which you did when you copied it from live to local, you have to update all the URLs and links at the new location.

    1. from the WAMP control panel, go to phpMyAdmin and change the home and site url in the wp-options table to your local path. If you named your local site’s folder test, then what you would enter is: https://localhost/test and this is the URL you will use to access the local site. Your login is then https://localhost/test/wp-admin

    2. once logged into the Dashboard, install and run this plugin to update all the links:

    https://www.ads-software.com/plugins/better-search-replace/

    3. when that is done, go to Settings > Permalinks and just click Save (this rebuilds the .htaccess file on the local site)

    Cheers!
    Lyle

    If you used your host’s ‘one-click’ installer, then you will have received an email from them with your login credentials.

    Note: you will never receive any email from www.ads-software.com for this sort of thing.

    If you manually installed it yourself, then your login credentials will be whatever you chose during the installation ??

    Cheers!
    Lyle

    Easiest way to get going is do another install.

    – make a folder in htdocs named newsite2
    – move all the WP files from a fresh download to this folder
    – create a new db named newsite2
    – start the install with: https://localhost:8888/newsite2
    – at the DB screen, enter:

    — DB Name: newsite2
    — DN User: root
    — DN Pwd: root
    — Hostname: localhost
    — Table prefix: wp_ (leave as-is)

    That’ll get you going ??

    If you moved all the files from within the WP folder to the ‘main body’ of htdocs, then your site is accessed by:

    https://localhost:8888

    It is generally not a good idea to do so as it ‘clutters up’ the root of the local server (htdocs). Makes this harder to manage when you add additional sites.

    What would have been better practices, is to just have renamed the wordpress folder within htdocs to ‘newsite`, then your site would have been accessed as you expected.

    Cheers!
    Lyle

Viewing 15 replies - 271 through 285 (of 301 total)