Jump to content

Local development setup


SamC
 Share

Recommended Posts

I've been doing local development for quite some time, so setting up up initially isn't a problem. What I could do with is some advice. What I do at the moment is not ideal but it works (although not what I would call 'robust'):

1)  PC - XAMPP (apache/php/mysql)
2) Macbook - MAMP (apache/php/mysql)
3) Dropbox on both - /dev/dev.mysite.com/PW-installation
4) Live hosting server with database
5) I connect to the files from dropbox, and the live database from both machines (in config.php, my hosting allows remote connection) and also test on mobile (once the files are uploaded to the live server)
6) Both machines are not always on, so connecting to a server on the other one isn't really an option
7) My virtualhosts and hosts are set up identically on each machine so the local URLs are the same
8) Both files and database are backed up on the server daily so I can rollback if something goes pear shaped

There is a good chance of human error in this setup and I have to be careful.

I frequently hop between macbook (sitting in bed) and PC (downstairs). Now this setup allows me to go between computers no problem and totally works. However, I don't really want to keep messing with the live database or store files in dropbox. I'm only doing this because I haven't got into git yet, never seems to be enough time. My initial discussions about using dropbox were here:

The live database bit concerns me, if something goes wrong, the whole lot is messed up, been lucky so far but that runs out eventually! I suppose I could create a 2nd database on the live sever DBNAME_dev and use that but interested to see how other people handle this type of situation.

I really need a decent solution before taking on paid work because this whole setup worries me and I think I'd be doing a dis-service by not having a solid foundation to begin with. I'm willing to get my hands dirty but I've never worked in an environment where tools for this sort of stuff are used, and how they do it etc.

I'm actually heading over to https://laracasts.com/series/git-me-some-version-control now to start the ball rolling but any advice is greatly appreciated, thanks.

Link to comment
Share on other sites

Learning Git has got to be a good thing (I need to learn more about it myself), but in terms of solving the "two computers for local development" issue in the quickest and simplest way I would have thought this would be the thing to look at:

8 hours ago, SamC said:

6) Both machines are not always on, so connecting to a server on the other one isn't really an option

I think you want a single version of the files and DB on the laptop (in case you need to work away from home some time) and then access those on the desktop machine via a local network. Just leave the laptop on when you want to work from the desktop.

Or another idea: just carry the laptop downstairs and work exclusively on that machine (I have a large external monitor and external keyboard I plug my laptop into when working at my desk).

  • Like 2
Link to comment
Share on other sites

@Robin S is right, Git will not solve your main issue. You might want to consider using online solutions, like: https://codeanywhere.com/pricing

To tell the truth, I do not have any experience with such services, so I do not know how much they can help regarding your database connections. I always work with two databases, local and live.

  • Like 1
Link to comment
Share on other sites

Thanks for the suggestions. I'll put this on the back burner, really need to stick at javascript for awhile first, although I'm finding it pretty tedious. Don't know what it is with me and javascript, been trying to learn it off and on since about 2004 to no avail, always quit and go mess about with CSS and design instead. I guess I don't have anything to actually use it for right now other than adding classes here and there. Then I was thinking last week about an ajax search which users could find pages on my site without navigating around by typing in questions, like "How much..." would pop up my pricing page etc, That would need javascript! And I'd have a goal. Then I saw this:

Copying and pasting wont get me anywhere, but this will really address the 'where to start' problem us wannabe developers have. Reading JS books and watching videos is all well and good but this gives me something to learn as I go along, makes all the difference to me.

Went a bit off topic there, but hey.

  • Like 1
Link to comment
Share on other sites

On 13/03/2017 at 8:15 AM, szabesz said:

@Robin S is right, Git will not solve your main issue. You might want to consider using online solutions, like: https://codeanywhere.com/pricing

To tell the truth, I do not have any experience with such services, so I do not know how much they can help regarding your database connections. I always work with two databases, local and live.

What I did in the end was create a second DB on my server appended '_dev'. Now I can just get on with building some stuff instead of wasting time :)

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...