You will need to edit /var/www/conf/httpd.conf, and enable the php mime-type by uncommenting:

Code:

#AddType application/x-httpd-php .php

You will also likely want to run Apache without the default chrooted environment. You will need to read FAQ 10.16.

ok so to run apache with out chroot i have edited the rc.conf to reflect >> httpd=-u. is this correct?

Also i am trying to edit the /var/www/conf/httpd.conf file using vi but i get the error read-only file, not written. i stopped apache and it stil did not help. any idea what is accessing the file to prevent me from editing it?

ok so to run apache with out chroot i have edited the rc.conf to reflect >> httpd=-u. is this correct?

No.

First, rc.conf contains only environment variables used by rc(8), it is not an executable script; local execution is done in rc.local(8).

Second, while there is an httpd related environment variable associated with Apache execution by rc(8), the variable is "httpd_flags".

Third, the best practice is to make local variable changes in rc.conf.local(5), rather than in rc.conf itself; as rc.conf is a system file subject to change during upgrades.

Quote:

Also i am trying to edit the /var/www/conf/httpd.conf file using vi but i get the error read-only file, not written. i stopped apache and it stil did not help. any idea what is accessing the file to prevent me from editing it?

A file marked read-only is ... read only. To override and save a new copy from vi(1), use the "w!" command, rather than the "w" command.

First, rc.conf contains only environment variables used by rc(8), it is not an executable script; local execution is done in rc.local(8).

Second, while there is an httpd related environment variable associated with Apache execution by rc(8), the variable is "httpd_flags".

Third, the best practice is to make local variable changes in rc.conf.local(5), rather than in rc.conf itself; as rc.conf is a system file subject to change during upgrades.A file marked read-only is ... read only. To override and save a new copy from vi(1), use the "w!" command, rather than the "w" command.

worked fine. i got the php up. tanx
Now let me digest all the first second & third explanation above bcos it seems like greek to me. lol

During a normal boot, the kernel probes your hardware (white text on blue background appears), then starts init(8). Init runs the rc(8) script -- it's a script you should look at some time, when you're bored -- the file is /etc/rc. When output switches from white-on-blue to white-on-black, you are seeing output from rc.

The rc script mounts partitions, configures and starts your network, starts daemons (background services, such as Apache), enables the console for log in, makes configuration settings .... and any other tasks need to prepare the OS for use.

rc uses a bunch of variables, which it reads from /etc/rc.conf, which describes settings that control what rc does. One example is the "httpd_flags" variable. By default, this is set to "NO", which tells rc not to start the Apache webserver.

After reading /etc/rc.conf, and setting variables, rc will then look for and read in /etc/rc.conf.local, if the file exists, and reset any variables accoring to the value(s) found in that file. So /etc/rc.conf.local settings *override* settings in /etc/rc.conf.

For 3rd party applications that have daemons, the rc.conf and rc.conf.local files are not used, as these only contain variables which rc knows about -- settings associated with built-in daemons, primarily.

After rc has completed running, it launches /etc/rc.local. The rc.local script is where you put 3rd party daemon startup commands, since rc.conf or rc.conf.local are not used.

Just like rc(8), apachectl acquires httpd_flag settings from rc.conf(8). rc.conf will source variables from rc.conf.local if it exists (the last two lines of rc.conf or rc.conf.local that you have commented out perform that function).

You have a recursion problem. My guess is that you copied rc.conf to rc.conf.local. That is not a valid rc.conf.local configuration. rc.conf.local should only contain local changes to rc(8) variables. For example, if on installation of OpenBSD, you elected not to have an sshd(8) service running, the install script will create a one-line rc.conf.local file containing sshd_flags=NO.

If you intend to use rc.conf.local, which is a best practice, please ensure that /etc/rc.conf is in the exact state it had when originally installed, and place only your local changes in rc.conf.local.