Apache,MySql,PHP on Windows vs. Linux

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Crazy (possibly dumb) question here...
I have a site running apache, mysql, php in a Win2K environment.
Primary development is that env also.  I also am setting up a linux box
(old laptop), to begin playing with Linux.  I'd like to set it up
similiary with apache,mysql, php.
If I do that, and start doing some development there (Linux box) - can
I expect that when I move the php code to the windows box that it will
behave similarly as it did on Linux?
Anything to watch out for?  I'm completely new to Linux...

thanks for your help...

Re: Apache,MySql,PHP on Windows vs. Linux


For that you have to install php,mysql,apache in linux and if u r using
php.ini with linux than u need to change error_repoting optiong 2 more
strict and try 2 user every where $_POST and $_GET and $_SERVER and
keep practice to assign each variable like $a = '' than over write
where you want and also use to check is_set to check post or get vars
after submitting page.  


Re: Apache,MySql,PHP on Windows vs. Linux


the linux version is much nicer to play with although i suggest you use
xwindows to do the development, if you like the command line stuff i
recommend you install vim or emacs as vi is spawn of the devil.

make sure that if you open any files in your scripts that the paths
have been changed to match their linux location unless your smart
enough to code with ../../../ etc... much easier. some php functions
behave differently with windows and linux but not mostly.

finally browsers are slightly different. if you are unfortunate enough
to use internet explorer then your pages especially the tables may draw
differently in mozilla, konqueror or firefox. i suggest firefox for
both windows and linux.

please be aware as you are new to linux you might find it very hard to
begin to use. stick at it as as they say 'everything else is just a
toy' ok i nicked that from toy soldiers but its true. make sure you
know someone with linux

good luck with it

Sean Barton

Re: Apache,MySql,PHP on Windows vs. Linux

and dont forget to replace all your \ with / in the paths,
just in case.

AND the linux shell is case sensitive, so /SOMETHING/ != /something/ ,
but it would work on windows

just a couple of thing to look out for


Re: Apache,MySql,PHP on Windows vs. Linux

Quoted text here. Click to load it

vim's OK.  had a few problems with vi once in a while.  massive problems and  
learning curve with emacs.
ahh - you emacs people... emacs makes my control and meta pinky hurt. :-)
but, in emacs you can do just about anything, I'll give it that - even send  
emails & compile programs.
to each his own I guess.  I found a favorite editor on my platform that's  
neither vi nor emacs.

One thing to keep in mind is that if you transfer files between the two  
boxes, you may want to do cr/lf conversions on the files if you are doing  
any editing.
PHP won't care about the cr/lf difference AFAIK.  but it's annoying in an  
When you port a UNIX file to windows, because there is no cr, and you open  
the file up in notepad, (dreamweaver fixes things great), notepad will run  
all the lines together in one big mash with little lf symbols sprinkled  
throughout.  That can be manually corrected.
You can probably find a free unix2pc crlf conversion utility out there for  
Windows.  or, just write a PHP script to convert the linefeeds using  
file_get_contents() and file_put_contents(), explode(), and implode().  UNIX  
already has these text tools built-in... I just forgot what they were - I  
think tr can be used, but it may be the hard way to do it.  On the UNIX box,  
make sure you install man pages (probably is by default, but make sure they  
are *all* installed).  then try using
man tr
man -k pc2unix
man -k pctounix | more
man -k crlf | more
and see if any commands pop up.
and remember that \r is a return, \n is a linefeed for the tr command (or  
most commands on UNIX).  on a pc, \r\n is the sequence.  on UNIX, I think  
it's simply \n.

Quoted text here. Click to load it

Re: Apache,MySql,PHP on Windows vs. Linux

Quoted text here. Click to load it

on unix to convert from dos format

 tr -d '\r' < dosfile > unixfile
to convert to dos format
 sed 's/$/\r/' < unixfile >dosfile

converting unix files on dos/windows is harder, but there are a number of free tools
on simtel.net (or you can use sed and tr if you have them installed...)


Re: Apache,MySql,PHP on Windows vs. Linux

Quoted text here. Click to load it

there is also a project called GNUISH MSDOS.  it only works with 8.3  
filenames though, so you'll probably lose your long filename.

Quoted text here. Click to load it

Re: Apache,MySql,PHP on Windows vs. Linux

Quoted text here. Click to load it

Make sure you know which options you compiled PHP on Windows with so you can
include those options when compiling/installing on Linux. Not sure if Windows
uses the php.ini file for its configuration, but may be worth viewing that so
you can carry over similar settings to your Linux setup.

Newsguy BonusBytes! - Free monthly rewards  

Site Timeline