Posted by: jasonk2600 | November 24, 2009

Quickie HowTo – Installing PHP 5.x on FreeBSD

Installation

Install Apache and PHP from the ports collection. NOTE: When configuring the PHP 5.x port, be sure to select the CGI and APACHE options.

# cd /usr/ports/www/apache22
# make config
# make install clean
# cd /usr/ports/lang/php5
# make config
# make install clean
# rehash

 

Configuration

Modify /usr/local/etc/apache22/httpd.conf and add the following lines:

<filesmatch  \.php$>
          SetHandler application/x-httpd-php
</FILESMATCH>

<IfModule dir_modules>
    DirectoryIndex index.html index.php
</IfModule>

Once Apache has been restarted it will recognize and run PHP scripts.

 

  [EoF]
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: