How to just:
Categories: Technical | design | Other | Food | All

How to get PHP4 working on OpenBSD

Description:

How to get PHP4 working on OpenBSD. I'm using PHP for nagios and my browser kept trying to download the PHP files instead of running them. No good. This is how to make it work.


(I'm doing this as root, probably a bad practice)
First, install PHP using ports:
 # pkg_add php4-core-4.4.1p3
Install the apache modules:
 # /usr/local/sbin/phpxs -s
Copy the php.ini file into the config directory:
 # cp /usr/local/share/examples/php4/php.ini-recommended /var/www/conf/php.ini
Reboot Apache:
 # apachectl restart
I put a test script into my root directory called "something.php", it contains the following:
 # cat /var/www/htdocs/something.php
 <html>
 <head>
 <title> PHP Test Script </title>
 </head>
 <body>
 <?php
 phpinfo( );
 ?>
 </body>
 </html>
I navigate here:
http://my_machine/something.php
And see something like this:
php working
If you see something like that, it means things are working. Congrats!
(This is largely being put here to remind myself how to do it. This is probably pretty incomplete.)

Link to this



Be sure to check out our other project, Thingist - Things you love Looking for other Technical articles?
Here is another random article from this category:

How to download flash videos from the internet (For my coolest friend ever)

How to download flash videos from the internet. How to download flip videos, and youtube videos, and probably every other kind of video you want. Hooray!

Read More
Be sure to check out our other project, Thingist - Things you love