corner imagecorner image
FeaturesPluginsDocs & SupportCommunityPartners

Configuring the PHP Development Environment in Solaris

This tutorial shows you how to set up the PHP development environment on OpenSolaris 2008.05 or the Sun Solaris Express Community Engine (SXCE). On both Solaris systems, the PHP engine, Apache server, and MySQL database server are included in a Web Stack package.

The SXCE dowload is available here.

OpenSolaris 2008.05 is available here.

Contents

Content on this page applies to NetBeans IDE 6.5

To follow this tutorial, you need the following software and resources.

Software or Resource Version Required
NetBeans IDE PHP download bundle 6.5
A PHP engine Version 5. Included in the amp-dev package.
A web serverApache HTTP Server 2.2 is recommended.
Included in the amp-dev package.
A database serverMySQL Server 5.0 is recommended.
Included in the amp-dev package.
A PHP debugger (optional) Included in the amp-dev package but disabled by default.

Installing the Web Stack on OpenSolaris 2008.05

Use the package manager or the command line to install the amp-dev web stack package. The amp-dev package includes the PHP engine, the Apache HTTP server, the MySQL database server, and the webstackui package, with desktop tools for using the AMP components. After the package is installed, the Applications > Developer Tools > Web Stack Admin menu is available.

On SXCE the web stack is installed by default. You only need to initialize it.

Initializing the Web Stack Components

Before you can use the AMP for Solaris, you need to initialize the Web Stack components.

To initialize the Web Stack:

  1. Choose Applications > Developers Tools > Web Stack Admin > Initialize.
    Initializing the Web Stack Admin
    The following Terminal appears:
    SXDE Terminal
  2. Press Enter upon a prompt. A context menu for Web Stack Admin appears. To configure a component, choose Options. To start/stop the Apache/MySQL server, choose the relevant menu item. You can also create and run a Sample App.
    SXDE Admin Options

Enabling Debugging and Configuring PHP Components

After you initialize the AMP package, you can enable debugging and configure other components.

To enable debugging and configure the AMP:

  1. Open the Options dialog (Applications > Developer Tools > Web Stack Admin > Options).
  2. In the Options dialog, open the PHP tab and select Enable Debugging. This enables the IDE's PHP debugging feature. (See Debugging PHP Source Code in the NetBeans IDE.)
    The PHP tab of the Web Stack Options dialog
  3. To see the information about your AMP configuration, click Show phpinfo. This runs the built-in <php-info> script.

The Options dialog also helps you perform the following configuration tasks:

  • In addition to debugging and running php-info, the PHP tab lets you set error reporting levels and gives you a quick link for opening php.ini if you need to edit it.
  • You can allow remote access to the MySQL server or edit the my.cnf configuration file from the MySQL tab.
  • You can start or stop the Apache servers from the General tab.
  • In the Apache2 tab, you can set the Apache port number, change the web directory (/var/apache2/2.2/htdocs by default), create separate home directories for different users in the web directory, and open the httpd.conf file for editing.
    Apache options tab in Options dialog


Learn more about the AMP Solaris package here.

To send comments and suggestions, get support, and keep informed on the latest developments on the NetBeans IDE PHP development features, join the mailing list.


Back to the PHP Learning Trail
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems