Originally Posted by dvdljns
When I was learning asp I got in the habit of building a db and moving it to a folder call db in the folder for the site. I lked having all my files in one place like that but I have never seen it done with mysql and php. with php the way seems to be to build a script and run that. It made it easy to carry my work around with me and also to move sites to other comps or a cd for storing. Now that I am in a linux only envirement I want the conveniance I had with windows. There is a lot of times I am waiting somewheres for an hour or more and would like to pop open my laptop and work on my current project. with asp you see a lot of sites built as examples that you can download that has eveything in it including the database. I just bought a sitepoint book called build your own dataase driven website using php and mysql and as I work my way through the book would like to save eveything to a memory card and carry it with me. can this be done using php and mysql.
Yes. Save your PHP files to the memory card, along with all the associated images, style sheets, etc. You can either open the files through the browser as "Open->File" through Firefox, or create a symbolic link in the docroot on the computer in question, and have it point to the memory card. Something like "ln -s /memory/card/filepath /srv/www/htdocs/memcard", then open it with "http://<server name>/memcard. That assumes you've got symlinks enabled in Apache, though.
The DB can be handled in two ways as well. MySQl has a config file, telling it where to put the DB files. You can either modify it to include the directory on your memory card, or you can do a mysqldump, and import it onto the box you're on.
If all of this is done on your laptop, things are easy. Do the symlink for the web pages, so that each project has a different path on your web server, like "ln -s /development/customer1 /srv/www/htdocs/cust1", etc., and keep separate database names for each customer in MySQL. Then you can open your laptop up, and fire away. When time comes to deploy, just do a MySQl dump of the database for that particular customer, and import it into their MySQL db server, and copy the web pages over.
You might also want to investigate using Apache to set up virtual hosts on your laptop, so you COULD then have "http://customer1.localhost.com", "http://customer2.localhost.com", etc....