Home Business IT Open Source Vamp the Linux LAMP with PHP

One key driver of free and open source software is the LAMP paradigm – cleverly named after the systems it embraces – Linux, Apache, MySQL and PHP. This powerful combination delivers high powered data-enabled web and intranet sites with a minimum of fuss. Here’s how to get started with PHP.

PHP is a web scripting language (akin to Microsoft’s Active Server Pages or Adobe’s ColdFusion.) Originally, it began as a humble collection of Perl scripts designed to ease the creation of popular web addons like guest books and message boards, PHP meaning simply “Personal Home Page.”

PHP is now in its 5th version and has received massive reworking and updates since its unpretentious beginnings, becoming a solid platform for building web sites at all levels. It provides basic interactive features through to dynamic enterprise applications. PHP is the most obvious starting point for learning how to work with the LAMP environment because it is the most visible component. PHP pages make up the user interface that people will interact with (whereas Linux and Apache provide the underlying engine, and MySQL gives database storage.)

Even if you do not actually run a Linux environment yourself, chances are your web host gives you PHP (and MySQL) for free. This is true of paid web hosts as well as any complimentary free web space that your ISP gives.

In fact, it’s well worth getting familiar with the basics of PHP just to enhance your own personal web page. It’s also worthwhile so you can debug or at least make sense of PHP pages you encounter. You’ll find it dead easy even if you’ve never programmed before.

Entering PHP mode
PHP code is interspersed with standard HTML tags. The web server – Apache, mostly, but PHP pre-processors can be added to IIS and other servers – receives a request from a web browser as usual. It picks up the PHP page and executes the programming commands inside, rendering any generated output along with the HTML tags. This final output is returned to the web browser, giving the illusion of an ordinary, static web page despite the fact it was generated right on the fly by the server.

The pre-processor fires when the web page suffix is .php instead of the regular .html (or .htm). It then looks inside the file for special tags which indicate where literal HTML output stops and PHP code begins. There are four possible tags that can be used, all achieving the same purpose:

<script language=”php”

When the pre-processor encounters one of these tags, it stops recognising text as HTML to be returned as-is and instead sees it as program code to execute. This continues until a closing tag is found, at which point the pre-processor just emits subsequent text as straight HTML again.

The closing tag must match the opening tag; use ?> for either of the first two options above, %> to close <% and </script> to match <script language=”php”>.

A variable is a data item that can have a value assigned to it. Over the course of the program you may alter this value and use it for display or in calculations.

Some languages are strict about how variables are used. If you specify it has integer values only you can’t then store a decimal number or a text string in it. PHP is different, and this is one of the reasons it is generally considered a fast language to work in. In PHP, a variable begins with a dollar sign ($) and that’s it; you do not explicitly state any restriction on the data it can hold. Instead, PHP will work out the data stored by how it is used and what’s more, it’ll go out of its way to help you work with different types of data.

Let’s put these together to make a real working PHP page.


Are your technicians spending too much time just managing your clients cloud backups?

Backups are an important part of any IT business but they should not consume more than their fair share of time and money.

Discover how to reduce the amount of time & money spent managing your Cloud Backups during this Free Webinar.



As one of the world’s largest social networking services, Facebook handles a lot of user information, and requires input from an astounding range of stakeholders 24 hours a day, 7 days a week — from both inside and outside the business.

Discover how Facebook was helped to connect remote employees, vendors, consultants, and partners to applications and web services quickly and reliably - without risking sensitive data.



Explore your Network Treasure Trove to get the IT Budget you want

With Australian businesses projected to spend over $78.7 Billion why does it feel like you can never get the budget you need?.

In most cases your budget will get approved because the proposals are not only technically correct, but also provide good, credible evidence on how the spend aligns with key business objectives.

Did you know that your Network Monitoring tool can help you build a comprehensive business case without an MBA?



David M Williams

joomla site stats

David has been computing since 1984 where he instantly gravitated to the family Commodore 64. He completed a Bachelor of Computer Science degree from 1990 to 1992, commencing full-time employment as a systems analyst at the end of that year. Within two years, he returned to his alma mater, the University of Newcastle, as a UNIX systems manager. This was a crucial time for UNIX at the University with the advent of the World-Wide-Web and the decline of VMS. David moved on to a brief stint in consulting, before returning to the University as IT Manager in 1998. In 2001, he joined an international software company as Asia-Pacific troubleshooter, specialising in AIX, HP/UX, Solaris and database systems. Settling down in Newcastle, David then found niche roles delivering hard-core tech to the recruitment industry and presently is the Chief Information Officer for a national resources company where he particularly specialises in mergers and acquisitions and enterprise applications.






Join the iTWire Community and be part of the latest news, invites to exclusive events, whitepapers and educational materials and oppertunities.
Why do I want to receive this daily update?
  • The latest features from iTWire
  • Free whitepaper downloads
  • Industry opportunities