corner imagecorner image
FeaturesPluginsPlatformDocs & SupportCommunityPartners

Configuring the PHP Development Environment in OpenSolaris

This tutorial shows you how to set up the PHP development environment on OpenSolaris. On Solaris systems, the PHP engine, Apache server, and MySQL database server are included in a Web Stack package.

OpenSolaris 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
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 Amp and Web Stack

Use the package manager or the command line to install the amp-dev 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.

Initializing the Web Stack Components

Before you can use the AMP for Solaris, you need to initialize the Web Stack components. This tutorial shows you how to initialize the Web Stack through the desktop UI.

To initialize the Web Stack:

  1. Choose Applications > Developers Tools > Web Stack Initialize.
    Initializing the Web Stack Admin
  2. A terminal appears and prompts you to type your root password. Type it and press Enter.

    If your password is not recognized, you need to add a "root" user and password. Open a terminal and enter the following command: pfexec usermod -K type=normal root. This creates a "root" user. Then enter the following command: pfexec passwd root. You are then prompted to enter a new password for "root." After you create the "root" user and password, you can initialize the web stack.

  3. A terminal opens with information about the progress of web stack initialization. When initialization is complete, press Enter to close this window.
  4. A Web Stack Admin menu is now available under Applications > Developer Tools. 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.

See Also

For more information about setting up the PHP environment on OpenSolaris, see the following resources:


Back to the PHP Learning Trail