Hudzilla.org - the homepage of Paul Hudson
Contents > Preface Wish List | Report Bug | About Me ]

1.7     Cross-platform PHP

This is NOT the latest copy of this book; click here for the latest version.

PHP works on many platforms, including Windows, Linux, BSD, Solaris, and Mac OS X to name just a few - this book attempts to cover PHP from an OS-agnostic point of view, which means I have tried hard to make sure you can understand and follow as much code as possible irrespective of what platform you use.

To make things easier to read, I have lumped Linux, BSD, Solaris, Mac OS, and other Unix-like OSs into "Unix" - this saves me typing and saves you reading, so everyone is a winner.

Throughout the book I refer to "shell prompts" and "command lines". This is the text entry system for your OS - for Windows NT/2000/XP users this can be found by clicking Start, then Run, and entering "cmd". Linux/BSD users running from the console are already there, but if you are using a GUI such as KDE or GNOME, you will need to launch xterm, Konsole, or whatever you use to enter text commands. Mac OS X users should have "Terminal" available for launching. I encourage use of the command line because it lets you use PHP in "interactive mode" - to type things, and see them happen immediately.

Finally, each platform has its own interpretation of line endings - what constitutes the end of a line of text. For Unix, a line end is just the new line character; for Windows, it is a new line plus a character feed; for Mac it is just a character feed. Crazy, yes, and annoying too. I have made this clear wherever new lines become an issue in this book.





<< 1.6 A note for programmers coming from C, C++, or Java   1.8 Tips for success >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
Ryan - 07 Sep 2008

Are the functions or features used in PHP, more advanced than the features using ASP.NET in visual studio 2005 (C#), in terms of creating interactive fully developed websites?

Thanx
Ryan Adams
South Africa

Pedro - 07 Sep 2008

Great idea about consolidating the OSs and I am glad PHP works on many platforms.

San Diego CA US - 26 Jan 2006

Jasen Betts - 07 Sep 2008

I thinks he does too.

Also Mac-OSX is unix like (BSD based actually) but prior versions (MacOS1 to MacOS9) weren't, and AFAIK don't have command-lines.

A PHP User - 07 Sep 2008

You could add Netware to the list of supported OS's because Apache and PHP are part of the standard distribution beginning with version 6.5.

A PHP User - 07 Sep 2008

I think you mean "carriage return" and "line feed", not "new line" and "character feed."



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is ten plus six?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow