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.
MySQL 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:
Choose Applications > Developers Tools > Web Stack Initialize.
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.
A terminal opens with information about the progress of web stack initialization. When initialization is complete, press Enter to close this window.
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.
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:
Open the Options dialog (Applications > Developer Tools > Web Stack Admin > Options).
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.
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: