How to just:
Categories: Technical | Food | design | Other | 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 set up a CGI proxy

So you want to set up a CGI proxy, do you? This is useful if you want to get around work filter, want to route your internet traffic through another country, want to conceal what you'e doing, etc.

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