Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > tips on developing PHP/MySQL with portable?

View Poll Results: Best hardware-scenario development environment?
Poll Options:
iBook or PowerBook and server 5 votes (83.33%)
Desktop and server 1 votes (16.67%)
I'm crazy, just the server 0 votes (0%)
Voters: 6. You may not vote on this poll
tips on developing PHP/MySQL with portable?
Thread Tools
Mac Elite
Join Date: Oct 1999
Status: Offline
Reply With Quote
Dec 29, 2002, 12:06 PM
 
Say, now that PHP and *nix tools are available on both my server and laptop, what's the best way to develop for the server (on the OS X laptop), if the PHP installs are on the server, but you modify only one or two config files, and don't want to download (or can't—á la permissions issues) the rest of the support files (e.g., squirrelmail, phpmyadmin)?

Remember, there are domain-name (localhost vs. my.domain.com) issues, AND different MySQL databases residing on each machine (I did think to connect to only ONE database, but what's the point of having a laptop?)

Thoughts, ideas, appreciated. Dreamweaver-specific, also?

Thanks!
     
Junior Member
Join Date: Feb 2002
Location: paris
Status: Offline
Reply With Quote
Jan 3, 2003, 06:19 AM
 
I don't know if this is what you're talking about, but you could start by creating a mysql user on the powerbook. This user should have the same name and password as the user on the server. Then at least your php scripts will work similarly on both machines.
You can get your own copy of phpMyAdmin for the powerbook.
Use .htaccess to tweak your php configs so that both machines are doing the same thing.

I hope that helps a bit.
     
Mac Enthusiast
Join Date: Aug 2001
Location: Durango CO
Status: Offline
Reply With Quote
Jan 9, 2003, 10:36 PM
 
well let me start you out

http://www.entropy.ch/software/welcome.html

and/or

http://www.serverlogistics.com/downloads-jag.php

basically you load mysql on your mac and turn on apache in your system prefs - it already has php. you can download phpmyadmin and basically copy the database on your server to your mac so you can fiddle with your scripts.

in your browser you go to

http://localhost/~yourusernamehere/yourwebsite

and in your filesystem put yourwebsite folder under your Home/Sites folder

make sense?

this is the beauty of os x, the ultimate web development platform since the web was invented.

now if you are serious you might get rid of the dreamweaver crutch and use bbedit - this is once you start to think in html and you can see what pages look like just be typing code.

also try and use the new xhtml with css and not the old html with the evil font tag. this will make your life easier in the long run.

ok? good luck then.
     
iomatic  (op)
Mac Elite
Join Date: Oct 1999
Status: Offline
Reply With Quote
Jan 9, 2003, 11:51 PM
 
i guess i wasn't being very clear; i'm already an intermediate scripting user, and have advanced CSS, HTML, DHTML, XML knowledge. i've already installed mysql, php, and have apache running with virtual hosts on both the server and the laptop.

what i wanted to know was how to smoothly develop on both a laptop and also a server, i.e., what are some good naming strategies, host setups etc. it's near impossible to upload to a server's /Library/WebServer/cgi-bin or /Documents/[script] directory.

so, let's say you have a laptop with the exact copy of the server's /Documents directory, in fact in your very own ../WebServer/Documents directory. you also have some prepackaged Perl and php scripts in certain folders in your server's /Documents directory, but you CAN'T modify them, because of permissions issues, get it? let's also say you have a script that calls www.domain.com instead of /localhost/; i assume you'd set up that way, but what if you were going to upload; that should work, right...? so the problem here is getting a seamless way to work between laptop and server.

am i talking crazy? i guess i may be...

thanks.

p.s., bbedit doesn't support webdav, uploading only changed files, and generally quick site development (the search and replace tool is perfect for web development)...i still sometimes (rarely) use bbedit, but Dreamweaver is far more efficient. try it sometime.

Originally posted by mania:
well let me start you out

http://www.entropy.ch/software/welcome.html

and/or

http://www.serverlogistics.com/downloads-jag.php

basically you load mysql on your mac and turn on apache in your system prefs - it already has php. you can download phpmyadmin and basically copy the database on your server to your mac so you can fiddle with your scripts.

in your browser you go to

http://localhost/~yourusernamehere/yourwebsite

and in your filesystem put yourwebsite folder under your Home/Sites folder

make sense?

this is the beauty of os x, the ultimate web development platform since the web was invented.

now if you are serious you might get rid of the dreamweaver crutch and use bbedit - this is once you start to think in html and you can see what pages look like just be typing code.

also try and use the new xhtml with css and not the old html with the evil font tag. this will make your life easier in the long run.

ok? good luck then.
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jan 10, 2003, 02:45 AM
 
Originally posted by iomatic:
i guess i wasn't being very clear; i'm already an intermediate scripting user, and have advanced CSS, HTML, DHTML, XML knowledge. i've already installed mysql, php, and have apache running with virtual hosts on both the server and the laptop.

what i wanted to know was how to smoothly develop on both a laptop and also a server, i.e., what are some good naming strategies, host setups etc. it's near impossible to upload to a server's /Library/WebServer/cgi-bin or /Documents/[script] directory.

so, let's say you have a laptop with the exact copy of the server's /Documents directory, in fact in your very own ../WebServer/Documents directory. you also have some prepackaged Perl and php scripts in certain folders in your server's /Documents directory, but you CAN'T modify them, because of permissions issues, get it? let's also say you have a script that calls www.domain.com instead of /localhost/; i assume you'd set up that way, but what if you were going to upload; that should work, right...? so the problem here is getting a seamless way to work between laptop and server.

am i talking crazy? i guess i may be...

thanks.

p.s., bbedit doesn't support webdav, uploading only changed files, and generally quick site development (the search and replace tool is perfect for web development)...i still sometimes (rarely) use bbedit, but Dreamweaver is far more efficient. try it sometime.
My 'server' is an iMac 600 with 10.2.3 client, PHP, MySQL, Perl, etc...

I've set it up so that the /Library/WebServer/Documents folder contains all my local virtual hosts. So if I've got 'test1.dev' (which I've set up using BIND), it's located at /Library/WebServer/Documents/test1/docs.

Using SharePoints, I just set the 'Documents' folder as a sharepoint and navigate to whichever site I'm working on. That way all users can share the same files and assets without getting versioning problems. I should probably set up WebDav on that folder, but that's for a rainy day.

This way, I have a 'properly' configured network that I can use without needing to FTP my changes - I work on the 'live' files and can immediately see my changes from any machine on the network. It also makes it easier to share with my fellow employees.

I make a client folder in Documents for each clients, and inside that use a 'docs' folder for the live site. On the same hierarchy I also keep a 'Source' folder for anything I receive from the client and an 'Assets' folder for all my Photoshop, Illustrator, Databases, etc...

Is this the kind of info you were after?
Computer thez nohhh...
     
iomatic  (op)
Mac Elite
Join Date: Oct 1999
Status: Offline
Reply With Quote
Jan 10, 2003, 08:56 AM
 
close. thanks.

i'm still not communicating; the keyword phrase i'm not using is "synch seamlessly". that's what i'm looking to do. you know, make changes on the laptop, hit a button, and all changes are uploaded to the server--sounds easy, right, but with mysql, protected executable files, etc., it's NOT easy.

thoughts appreciated.

thanks.

Originally posted by Simon Mundy:
My 'server' is an iMac 600 with 10.2.3 client, PHP, MySQL, Perl, etc...

I've set it up so that the /Library/WebServer/Documents folder contains all my local virtual hosts. So if I've got 'test1.dev' (which I've set up using BIND), it's located at /Library/WebServer/Documents/test1/docs.

Using SharePoints, I just set the 'Documents' folder as a sharepoint and navigate to whichever site I'm working on. That way all users can share the same files and assets without getting versioning problems. I should probably set up WebDav on that folder, but that's for a rainy day.

This way, I have a 'properly' configured network that I can use without needing to FTP my changes - I work on the 'live' files and can immediately see my changes from any machine on the network. It also makes it easier to share with my fellow employees.

I make a client folder in Documents for each clients, and inside that use a 'docs' folder for the live site. On the same hierarchy I also keep a 'Source' folder for anything I receive from the client and an 'Assets' folder for all my Photoshop, Illustrator, Databases, etc...

Is this the kind of info you were after?
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Washington, DC
Status: Offline
Reply With Quote
Jan 10, 2003, 10:02 AM
 
Dont know if such a thing exists. You'd probably need to write custom scripts to do all that.

I do a great deal of development, and I also have a desktop and ibook, which I use depending on the situation.

My solution, which works pretty well is to use CVS to keep my source code synchronized. Then for the databases, I have mysql on the server, and when I am on the laptop, I have it use the mysql server on the desktop. You can set up a pretty good system using hosts and aliases.

I also keep a sql schema description, along with a smaller set of importable data under source control so that if I'm on the road or not able to connect to the desktop, I can create the mysql database on the laptop and dump in the data. Then I just need to update the host alias to get it to point to the localhost server instead and I'm good to go.
     
Mac Elite
Join Date: Aug 2000
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Jan 10, 2003, 11:01 AM
 
I didn't develop the site I maintain now, but it was created using a CVS (content versioning system).

You should be able to install and get something like that working.

What I have to do for my updates is to:

go to the directory with new files:
cvs add [filename]
cvs commit

change to the computer/directory with the 'live site' and type:
cvs update -dP

This versioning system handles the moving of files to the live site and works well. The databases are independent though (which may or may not be what you want).

Look into it though.
http://freshmeat.net/projects/cvs/?topic_id=53%2C52

The coolest thing, is the php site is written with tests to know if its on the live or testing server. If its on the testing server, it can behave differently (not send out invoices or other).
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2