• Resolved talino

    (@talino)


    Hello world,

    Scavenging my way around WP docs and assorted PHP scripts, I’ve managed to put up a reasonably functional website which looks more or less the way I wanted (nothing spectacular). I’ve spent a week developing with MAMP (Mac Apache MySQL PHP), CSS Edit and a text editor. The SQL database is located directly on my ISP’s server and this is the one which was used for posts & pages. Everything else (templates, CSS, PHP, images, audio) was running from my /localhost/ before publishing, but WP was referencing the online database at all times.

    Finally a happy moment arrived, when I’ve uploaded the works and went to the dashboard to change 192.168.0.4 into http://www.mysite.com. It works fine.

    However, I’ve learned pretty quickly that WP stores its root folder in the SQL database (or so it seems). Now, if I want to test a change to the template, I simply cannot change the root folder to my local server because then the entire online site will go offline.

    This is not only extremely difficult for PHP stuff but also for CSS. Using CSS Edit I can preview changes in realtime on my Mac, but I have a networked PC on which I run IE6 just to see how it screws up layouts. I can’t do that anymore.

    Yes, I know, I should have thought of that beforehand. But I didn’t.

    Do I need to replicate the SQL database locally in order to develop safely before committing templates to the world, or is there another way?

    Thanks a lot for your help.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Keep in mind first that I don’t do macs, so anything I say will be “suspect” from that angle….

    Given that, though, yes; you do need a local version of the database. I just dump one with enough posts, pages etc. and use it for every site I develop locally; it doesn’t matter what’s in it, only that there’s enough stuff to “work”….

    I’m having a similar issue also. I use MAMP and develop offline, but few things are diffcult to do completely offline. I usually just create faux posts and pages to test how they would look.

    Thread Starter talino

    (@talino)

    I see. Do you use that method even on fully-functional sites, for doing stuff like changing background images or seeing what the sidebar would look like if it had a 1px margin? And then synchronize the local template with the server?

    And BTW, developing on a Mac doesn’t make one suspicious (nor a zealot)… 🙂

    I don’t synchronize anything.
    I have a local install (including MySQL db) and many online installs.
    For designing themes and testing tweaks… I work on my local (XAMPP) install.
    If it’s OK, I upload the theme to the server.
    It can’t be simpler, I guess.

    *dittos moshu*….

    Thread Starter talino

    (@talino)

    OK, thanks a lot. I’ve followed your advice and created a db locally, reinstalled WP while keeping my (now online) theme and templates. However, when I try to delete the “Hello World” post (I want to import some real-world stuff from my site in order to work), I get a “You don’t have permission to do that” message in the Dashboard. I’m logged in as the sole and one and only admin here – what could be the problem?

    Huh. That’s a new one…. well, you don’t actually have to delete that one…. just dump (backup) the online database, and use whatever approximates the mac version of phpmyadmin to import the dump to your local database.

    There’s a tutorial here: http://tamba2.org.uk/wordpress/ in the phpmyadmin section. Not sure what in there might be applicable to your specific situation.

    Be sure you go into the database after you import it and change the siteurl and home values to whatever the local addresses really are.

    And I’m NOT sure this will fix your stated problem. It’s just that deleting the post isn’t needed in order to input the database stuff you really want. And if it still happens after you get the “real” db loaded, let us know and we’ll dig s’more….

    Thread Starter talino

    (@talino)

    It’s been quite an evening. I fired up my local server and created a database. Went online with my ISP’s phpmyadmin and exported my online database. Back here, I imported it into the local server. Then I changed my local wp-config.php to point to the new db, server, user and password. What I now get is a goofed-up Dashboard which does the following:

    http://192.168.0.4/wp/wp-admin/

    This shows the Dashboard.

    But the “Options” link (or any link for that matter) points to http://www.mysite.com/wp/wp-admin/whatever.php , so I can’t even change the WP root. I managed to get there once, dunno how, and I almost trashed the online site completely. This is delicate stuff. Anyway, I’m now locked in a local server which amazingly points to an online server when its own config file is telling it to go somewhere else.

    Bloody nightmare.

    I’d really like to know where the WP root settings are stored within the db so I could just go there and fix it myself.

    Thanks.

    http://www.tamba2.org.uk/wordpress/site-url/
    foloow the guuide to change the 2 values

    Thread Starter talino

    (@talino)

    Thank you so much. No words. Problem solved.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘How do you good people develop offline?’ is closed to new replies.