Zend - The PHP Company


Step 1: Create a new PHP file

1. Using Zend Studio for Eclipse or any IDE or text editor, create a file containing the following text:

  1. <?php
  2. echo "Hello, World";
  3. ?>

Alternatively, you can download and extract the file. 

2. Save this file as 'hello1.php'.

See Behind the Code for an explanation of this code sample.

Step 2: Copy the file to your Zend Server's document root

Step 3: Run your application

Open a Web browser and browse to the URL of your file, located at http://localhost:<port>/hello1.php .

Congratulations

You have just run your first PHP script using Zend Server. The words “Hello, World” will be displayed in your browser.

Hello World Browser Screenshot

What next?

Behind The Code


  1. <?php
  2. echo "Hello, World";
  3. ?>

The “Hello World” sample application is a basic PHP application which displays the words “Hello, World” in a browser. Learning how to display the words “Hello, World” on a screen is a common first lesson for most programming languages.

Let's break up the code in our application to see what each line is doing:

  1. <?php

This line contains the opening PHP tag. PHP was originally designed to be embedded into HTML or other markup formats such as XML. In order to let the PHP interpreter know that the code to be run is PHP code, the relevant code needs to be enclosed in PHP tags. Any text which is not enclosed in PHP tags will not be evaluated by the PHP interpreter, and will be printed directly to the browser.

  1. echo "Hello, World";

The second line is where the magic happens. The 'echo' function tells PHP to print something to the screen. The words enclosed in quotes tell PHP what to print – in this case, the words “Hello, World”. The semicolon at the end of the line tells the interpreter that this is the end of the instruction. Most instructions in PHP must end with a semicolon.

  1. ?>

This is the closing PHP tag.

Tip: The ending PHP tag is optional, and unless you plan to have HTML or other output after the PHP block, you can omit it.

Resources
FORUMS

Visit Zend Server Forum more»

WHITE PAPER

Application Leadership Today -- DevOps: Agile Delivery for Competitive Edge more»

WEBINAR

Discover how Zend Server 6 bridges the Devops chasm more»

CASE STUDY

Learn how Offers.com used the Zend solutions to build and manage a highly successful e-commerce website more»

DOCUMENTATION

Online Documentation more»

Customer Quote

   When it comes to ROI, we consider our investment in Zend technology to be a benefit on several fronts. It is easy to manage the PHP stack, and the strength of the error detection and reporting helps us reduce the time spent troubleshooting while increasing application availability and responsiveness. With session clustering alone, Zend more than paid for itself the moment we flipped the switch.   

Eric LongSr. Manager, E-Business, Levolor

   Zend Server paid for itself by virtue of the issues we found and fixed in the first week alone a benefit that is magnified exponentially as our e-commerce application grows.   

Josh ButtsDirector of Web Development, Offers.com

   We used the Code Tracing feature to optimize the DataCache parameters. It would have been very hard to track this down without the ability to trace the code directly in the production environment. We got a huge performance boost.   

Morgan NilssonSystem Developer, Ateles Consulting AB