1) Setting up Apache
OpenBSD have a custom Apache 1.3 installed by default. There's also Apache 2 package but I'll just focus with what's already there. To get the Apache running I just edit /etc/rc.conf.local and add:
2) Setting up PostgreSQL
I installed these packages:
After installation, you can see the brief steps you need to take to enable PostgreSQL. I had problem using su - _postgresql because I kept getting wrong password. After searching for answer, I found a way for that.
2.1) Set password for _postgresql
# passwd _postgresql
Then after the password for user _postgresql has been set, I can finally follow the brief tips for starting up PostgreSQL (which can also be read at /usr/local/share/doc/postgresql/README.OpenBSD).
# su - _postgresql
# mkdir /var/postgresql/data
# initdb -D /var/postgresql/data -U postgres -A md5 -W
You can follow the rest of the steps contained inside /usr/local/share/doc/postgresql/README.OpenBSD. I also read somewhere on the net that I need to edit /etc/rc.conf.local and add this line:
2.2) Set up phpPgAdmin
I installed phpPgAdmin-4.2.3 package which will also install core php5 packages. I had a problem trying to log in to phpPgAdmin using postgres id which has been created earlier. After googling for answer, here's the way to do that. Edit the file /var/www/phpPgAdmin/conf/config.inc.php. Then edit/add the bolded text.
// Hostname or IP address for server. Use '' for UNIX domain socket.
// use 'localhost' for TCP/IP connection on this computer
$conf['servers']['host'] = 'localhost';
// If extra login security is true, then logins via phpPgAdmin with no
// password or certain usernames (pgsql, postgres, root, administrator)
// will be denied. Only set this false once you have read the FAQ and
// understand how to change PostgreSQL's pg_hba.conf to enable
// passworded local connections.
$conf['extra_login_security'] = false;
Then after that I can log in using postgres id and manage the PostgreSQL database. There's also pgadmin3 program which uses wxWidget, a GUI program to manage PostgreSQL database.
3) Install PHP5
As I wanted to try out P4A - PHP For Applications - PHP RAD Framework, the relevant PHP5 packages I installed is:
Installation is straightforward and there's brief description on how to enable PHP5 support + testing out PHP5.
4) Set up P4A - PHP For Applications - PHP RAD Framework
http://p4a.sourceforge.net/ have the nescessary files for the application. I downloaded p4a-3.8.1.zip from the site, unzip the package and rename the p4a-3.8.1 folder to p4a. After that I move the folder to /var/www/htdocs/. When I open up http://localhost/p4a/ using Firefox, I can see the P4A page.
5) Install NetBeans + PHP plugins.
I installed NetBeans 6.9 from OpenBSD's package. I know NetBeans still have weird character issue on compiling Java codes but I'm not using NetBeans to write Java program. Instead, I want to use NetBeans to write PHP codes. So after I installed NetBeans from package, I installed PHP related plugins. After that, I wrote the hello_world sample P4A code which is available in the P4A website and wallah! It's working. I've also linked NetBeans with PostgreSQL and it's working fine.
So far, all is ok. I'm studying PHP bits by bits, slowly as a serious hobby rather than serious work. One thing for sure, this is a start. Later.