Using development system before uploading to web

Using development system before uploading to web

am 28.10.2005 20:22:32 von Phil Nospam

I'm looking at starting a web site that will have a couple mySql databases
and I have a couple high level questions that should be easy for you guys
and gals.

First, my background --- I'm familiar with HTML but haven't done anything
with PHP yet. I'm familiar with MS Access and somewhat familiar with Sql
select statements from modifying sql queries in some data mining software we
used at work (Brio with Oracle/Informix databases). It's been about 4 years
since using Visual Basic and 10 since using tcl/tk. I understand the
concept of having a development environment and a production environment for
databases (you can't risk users being offline or receiving errors by
monkeying around with the real thing).

Now the questions ---

1) If I use one of these inexpensive hosting companies, the kind that have
web sites with mysql/php capabilities for under $100 per year, how should I
set up my development environment? Should I set up a development database
system at home or on the cheap web host?

2) If my databases will have some fields containing URLs to pages on my site
and other URLs to other web sites, what kind of problems will I face when I
try to update the production DB with what I've developed on the development
DB?

3) Concidering the above question, should I try to stick with relative or
static URLs for links to my web site?

Thanks in advance for your replies,

Phil

Re: Using development system before uploading to web

am 28.10.2005 22:00:11 von Shion

Phil Nospam wrote:

> 1) If I use one of these inexpensive hosting companies, the kind that have
> web sites with mysql/php capabilities for under $100 per year, how should I
> set up my development environment? Should I set up a development database
> system at home or on the cheap web host?

I think it's better to have the development environment close by, if it's your
private site, then have it at home. This speeds up things like modify the
files or database fast and test run things will be fast too. This may not be
true for remote servers.
Do run a phpinfo() on the hosts machine, so you know what "extensions" they
use, so you can setup a php on your local server which can do the same things.


> 2) If my databases will have some fields containing URLs to pages on my site
> and other URLs to other web sites, what kind of problems will I face when I
> try to update the production DB with what I've developed on the development
> DB?

Don't use hard coded URLs, you let the php script to "ask" the web server what
ip-name it uses and then just hard code the path.

$mainpage=$_SERVER['SERVER_NAME']."/index.php";


> 3) Concidering the above question, should I try to stick with relative or
> static URLs for links to my web site?

Relative are better, as if you would make changes in your system or you change
URL or something, then you have the bad job of finding all those static URLs
before things will work okey.


//Aho

Re: Using development system before uploading to web

am 29.10.2005 01:31:45 von Phil Nospam

"J.O. Aho" wrote in message
news:3sfe4kFnto1oU1@individual.net...
> Phil Nospam wrote:
>
>
> > 2) If my databases will have some fields containing URLs to pages on my
site
> > and other URLs to other web sites, what kind of problems will I face
when I
> > try to update the production DB with what I've developed on the
development
> > DB?
>
> Don't use hard coded URLs, you let the php script to "ask" the web server
what
> ip-name it uses and then just hard code the path.
>
> $mainpage=$_SERVER['SERVER_NAME']."/index.php";
>
>
> //Aho

Thanks Aho.

I thought that having it at home would be better but was concerned about
errors that would occur after uploading when the paths/server names might
not match up exactly. Your explanation above is most helpful. As you might
be able to tell, I'm not a DBA and have never taken any courses (not even
for the Brio/Oracle stuff I did). I just tend to be thrust into things at
work because they see I have good general computer knowledge and can learn
new skills/concepts very quickly.

One more thing about your response above. Let's assume that I register the
domain www.mywebsite.com. Would that line look like this:

$mainpage=$_SERVER['www.mywebsite.com']."/index.php";

I'm picking up a used PC on Monday from a state government surplus warehouse
to use as my development PC/Server at home. 900MHz Pentium3 with 512MB
RAM, 40GB HD, CD burner, ZIP drive, two NICs, dual VGA output video card,
and I think there was an internal tape backup - very sweet for $50. As much
as possible I'm going to try and install the same versions of
Linux/Apache/mySql and other software as the host I choose. When I set this
up, will I then adjust the line above to read:

$mainpage=$_SERVER['my_development_server_name']."/index.php ";

Thanks again for your help...

Phil

Re: Using development system before uploading to web

am 01.11.2005 16:54:33 von q

"Phil Nospam" wrote in message
news:Bxy8f.20$0D4.15728@twister.southeast.rr.com...
> "J.O. Aho" wrote in message
> news:3sfe4kFnto1oU1@individual.net...
> > Phil Nospam wrote:
> >
> >
> > > 2) If my databases will have some fields containing URLs to pages on
my
> site
> > > and other URLs to other web sites, what kind of problems will I face
> when I
> > > try to update the production DB with what I've developed on the
> development
> > > DB?
> >
> > Don't use hard coded URLs, you let the php script to "ask" the web
server
> what
> > ip-name it uses and then just hard code the path.
> >
> > $mainpage=$_SERVER['SERVER_NAME']."/index.php";
> >
> >
> > //Aho
>
> Thanks Aho.
>
> I thought that having it at home would be better but was concerned about
> errors that would occur after uploading when the paths/server names might
> not match up exactly. Your explanation above is most helpful. As you
might
> be able to tell, I'm not a DBA and have never taken any courses (not even
> for the Brio/Oracle stuff I did). I just tend to be thrust into things at
> work because they see I have good general computer knowledge and can learn
> new skills/concepts very quickly.
>
> One more thing about your response above. Let's assume that I register
the
> domain www.mywebsite.com. Would that line look like this:
>
> $mainpage=$_SERVER['www.mywebsite.com']."/index.php";
>
> I'm picking up a used PC on Monday from a state government surplus
warehouse
> to use as my development PC/Server at home. 900MHz Pentium3 with 512MB
> RAM, 40GB HD, CD burner, ZIP drive, two NICs, dual VGA output video card,
> and I think there was an internal tape backup - very sweet for $50. As
much
> as possible I'm going to try and install the same versions of
> Linux/Apache/mySql and other software as the host I choose. When I set
this
> up, will I then adjust the line above to read:
>
> $mainpage=$_SERVER['my_development_server_name']."/index.php ";
>
> Thanks again for your help...
>
> Phil
>
>
>
Hi Phil,

Adding to what Ado said, the php code $_SERVER['SERVER_NAME'] allows you to
define 'SERVER_NAME' = 'my_development_server_name' in a config file, so you
only have to type this once. This is what makes php transportable, since the
config file is the only one you need to change when moving from server to
server. Similarly, the location of your mySql server and connection details
are defined just once. Everything flows on from there, since folder names
refer to the server, and file names to the folder etc.

Like you, I decided to develop my own php site armed with a fair bit of
expertise with HTML and databases, and one year later I'm still at it! My
site is very complex, with 800 pages, but I'm only customising proprietary
software, and it's been the steepest learning curve I've ever been on.

I strongly recommend you seek out some online tutorials before you begin,
firstly on installing and configuring Linux/Apache/mySql and php, which is
no mean feat, then on building a website with php and mySql. There are lots
of good ones around, and they will save weeks, maybe months of frustration.
Bear in mind it's all OpenSource, so although there are manuals, they're not
written with customer service in mind. Nor are there any simple editing
tools for these programs as there are for HTML, and just to make things
really difficult, it's not possible to see the source code of web pages
you'd like to emulate. I mistakenly thought it would be like learning
Javascript, but after trawling through countless sites looking for code
snippets that either don't work or cost money, I think the best (only) place
to see examples of working scripts is at koders.com.

One final tip - try and choose a hosting service that can offer some support
with php code. I'm at quadrahosting.com and they've been brilliant.

Cheers,
Jem

Re: Using development system before uploading to web

am 01.11.2005 17:05:13 von Shion

q wrote:

> Adding to what Aho said, the php code $_SERVER['SERVER_NAME'] allows you to
> define 'SERVER_NAME' = 'my_development_server_name' in a config file, so you
> only have to type this once.

As $_SERVER['SERVER_NAME'] gets the hostname from web server, you don't define
anything, if you enum SERVER_NAME then you will get a false result from the
$_SERVER['SERVER_NAME'].
With other words, you don't have to configure anything at all.


> I strongly recommend you seek out some online tutorials before you begin,
> firstly on installing and configuring Linux/Apache/mySql and php, which is
> no mean feat, then on building a website with php and mySql. There are lots
> of good ones around, and they will save weeks, maybe months of frustration.
> Bear in mind it's all OpenSource, so although there are manuals, they're not
> written with customer service in mind.

Don't forget that much opensource is released under GPL, which means you have
to release your modified code under GPL too.


//Aho