Now, that you have installed Zend Framework you can test it to be sure it is installed correctly. There are two methods we'll cover here to be sure it is installed correctly and functioning as it should. If you have not installed Zend Framework and would like to do so, please see our tutorial. 

Setting up an Installation Checker script

Please visit the following link for actual code to the installationchecker.php file.

  1. First, you'll need to log cPanel and go to the file manager and then create a 'New File' in your public_html folder called "installationchecker.php"
  2. Once the file is created, right-click on the file and select "Code Edit"
  3. Paste the code from above link into the file and click "save"
  4. Now, visit the file in your web browser by going to http://yourdomain.com/installationchecker.php Be sure to replace yourdomain.com with your actual domain. You should now see a results page like the one below.
  5. install_check_1

Creating a "Hello World" script to test Zend Framework

In this section of the tutorial we're going to show you how to create a "Hello World" script using Zend Framework. This 'Hello World' script is not designed to print to your screen but creates a file called "hello.php" in the same folder. 

  1. First, you'll need to log into cPanel and create a file in File Manager in the public_html folder called "hello_Zend.php"
  2. Next, you'll need to copy the code below and use "Code Edit" to paste the code into your hello_Zend.php file
  3. <?php
    require_once 'Zend/Pdf.php';
     
    /* create a new pdf document */
    $pdf = new Zend_Pdf();
     
    /* create a page */
    $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_LETTER_LANDSCAPE);
     
    /* setup font */
    $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
     
    /* write text to page */
    $page->setFont($font, 48);
    $page->drawText('Hello, World!', 250, 500);
     
    /* add page to document */
    $pdf->pages[] = $page;
     
    /* save pdf */
    $pdf->save('hello.pdf');
    ?>
    
  4. Once you have saved the file, you will need to visit the file you have just created in a web browser. The file will be located at http://youdomain.com/hello_Zend.php Be sure to replace yourdomain.com with your actual domain. Please note, the file will not display anything on the screen. The 'Hello World' file we just created is actually designed to create a PDF file in the same directory called "hello.pdf"
  5. Look in file manager, within cPanel and verify the pdf file was created. Be sure to refresh cPanel to see the file if you are still logged in. Now, visit the file in your web browser by going to http://yourdomain.com/hello.pdf  You should see something similar as below:
  6. hello_world_2

If you see the results as the above screenshot, you have been successful in creating your first Zend Framework 'Hello World' script. If you need further assistance please feel free to contact our support department.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

1 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!