Quercus: Hello, World installation
Resin 3.0

Features
Installation
Configuration
Web Applications
IOC/AOP
Resources
JSP
Quercus
Servlets and Filters
Databases
Admin (JMX)
CMP
EJB
Amber
EJB 3.0
Security
XML and XSLT
XTP
JMS
Performance
Protocols
Third-party
Troubleshooting/FAQ

Tutorials

Hello World
Java Modules
JSON
Tutorials
Tutorials
Java Modules

Find this tutorial in: /usr/local/resin/webapps/resin-doc/quercus/tutorial/hello
Try the Tutorial

The Hello, World tutorial covers the basic steps to start Resin and run a trivial php script in Quercus.

  1. Files in this tutorial
  2. Introduction
  3. Part I: Installing Resin
    1. Downloading and unzipping Resin
    2. Running Resin for the first time
  4. Part II: Configuring Resin to Serve PHP Pages
  5. Conclusion

Files in this tutorial

WEB-INF/resin-web.xml web.xml configuration
hello.php The PHP Hello, World

Introduction

This short article is intended for PHP programers who are interested in trying Caucho's PHP implementation. The download and unzipping instructions are intended for windows users. However, the implementation will work just as well in UNIX.

Part I: Installing Resin

Downloading and unzipping Resin

  1. Navigate to http://www.caucho.com/download
  2. Download the latest Resin binary for your operating system.
  3. For purposes of this demo, I have downloaded the Windows .zip binary. The non-pro version is open-source.
  4. Save the file to your desktop.
  5. Double click the binary and unzip the file.
  6. For purposes of this demo, I have unzipped the contents to C:\resin-3.0.14

Running Resin for the first time

  1. Browse to the directory into which you unzipped the resin download (ie: C:\resin-3.0.14)
  2. Double-click httpd.exe. At this point the resin web server should start.
  3. Open your favorite browser and type in the following URL: http://localhost:8080
  4. You will now see Resin's Default Home Page

Part II: Configuring Resin to Serve PHP Pages

  1. Cut and paste the "resin-web.xml" into your favorite text editor.
  2. Save the file into C:\resin-3.0.14\webapps\ROOT\WEB-INF (NB: if you use Notepad, then be careful to either save as "all files" or just put the file name in double quotes. IE: "resin-web.xml").
  3. Cut and paste the "hello-world.php" into your text editor.
  4. Save the file into C:\resin-3.0.14\webapps\ROOT
  5. Open your favorite browser and type in the following URL: http://localhost:8080/hello-world.php.

WEB-INF/resin-web.xml
<web-app xmlns="http://caucho.com/ns/resin">
   <servlet-mapping url-pattern="*.php"
                    servlet-class="com.caucho.quercus.servlet.QuercusServlet">
   </servlet-mapping>
</web-app>

hello-world.php
<?php
   echo "Hello World";
?>

Conclusion

If all went well with the above steps, you have installed Resin correctly. Congratulations!

You can now create your own PHP pages and store them in the same directory as the hello-world.php file.

Try the Tutorial


Tutorials
Tutorials
Java Modules
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.