20071128 Wednesday November 28, 2007

Hello NetBeans, this is PHP!

Do you know that you can use NetBeans to build web applications using PHP? PHP plug-in is an extension to the NetBeans IDE that enables you to perform web based development on NetBeans. While there are several PHP IDEs available in the market today, NetBeans PHP plug-in offers the same functionalities offered by other IDEs and then much more. Here is a short note to quickly get you started with NetBeans PHP plug-in in Solaris.

What do you need?

1. Solaris OS
2. NetBeans 6.1 Nightly Build
3. Apache 2.2 and PHP 5.2.4 (Get the CoolStack)

After installing the NetBeans 6.1 nightly build, Go to Tools > Plugins > Available Plugins



Select PHP plug-in and click Install. Follow the screens and restart the IDE.

After installing CoolStack, start httpd. Make sure Apache is running by pointing your browser to http://localhost.

In the Services tab select Web Servers > Add Host and select Local Web Server.



Then, provide the correct path to Apache 2 configuration file.



Enter a valid Document Root for Apache2 [Accept the defaults].



After finishing with the configuration, you should see Apache2 connection under Web Servers as shown below:



For creating a new PHP project, select File > New Project and select PHP Project from the PHP category.



Provide a target server for your PHP project.



In your PHP code, type phpinfo(); to get the PHP configuration information.



OK, now is my simple PHP code:



You can right click the project and select Run Project to view the output on a browser. There are also NetBeans modules for PHP Debugging.

Check out the NetBeans PHP Wiki for more information.

( Nov 28 2007, 02:45:54 AM PST ) Permalink Comments [4]
20071104 Sunday November 04, 2007

Solaris, PostgreSQL, and NetBeans - Just Perfect!

PostgreSQL is the open source enterprise database platform fully integrated into Solaris 10 and Solaris Express Developer Edition (SXDE) with comprehensive support offerings from Sun.
Unlike many proprietary databases, PostgreSQL is known as the 'failsafe DB' among the community and do you know PostgreSQL on Solaris along with NetBeans 6.0 is one skull of a combination? Here is a note on quickly setting up PostgreSQL 8.2 on SXDE 9/07 to make it work with NetBeans 6.0.
PostgreSQL is free of charge, and Sun includes a version of the database with every Solaris distributions since last June. So you are spared from downloading, building or doing any pre-installation act.

And this is straight from my console. Nothing less, nothing more, just 2 commands(highlighted):

bash-3.2$ su
Password:
# chown postgres:postgres /var/postgres/8.2/data
# su - postgres
$ bash
bash-3.2$ /usr/postgres/8.2/bin/initdb -D /var/postgres/8.2/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale C.
fixing permissions on existing directory /var/postgres/8.2/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in /var/postgres/8.2/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    /usr/postgres/8.2/bin/postgres -D /var/postgres/8.2/data
or 
    /usr/postgres/8.2/bin/pg_ctl -D /var/postgres/8.2/data -l logfile start

bash-3.2$ su
Password:
# /usr/sbin/svcadm enable postgresql:version_82

And now PostgreSQL server is up.

You need to have NetBeans 6.0 Beta 2 to try this out. Starting from NetBeans 6.0 Beta 2, the PostgreSQL driver comes bundled with the IDE.
















If you don't know already, a single Sun Fire T2000 Server running PostgreSQL 8.2 database and Solaris OS achieved the highest open source database performance on the SPECjAppServer2004 benchmark.
So try out this perfect combination - NetBeans 6.0, Solaris OS, and PostgreSQL.

( Nov 04 2007, 04:16:02 AM PST ) Permalink Comments [1]