Home > FreeBSD > Install Php for Apache22 on FreeBSD

Install Php for Apache22 on FreeBSD

Install php5
cd /usr/ports/lang/php5
make install clean

Note: portaudit may stop installation because of vulnarabilities of php5 port. In order to solve this problem give following command.
make -DDISABLE_VULNERABILITIES install clean

Install php5 extras

cd /usr/ports/databases/php5-mysql
make install clean

cd /usr/ports/www/php5-session
make install clean

cd /usr/ports/graphics/php5-gd
make install clean

Append following lines to httpd.conf file.
nano -w /usr/local/etc/apache22/httpd.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Update DirectoryIndex
DirectoryIndex index.php index.html index.htm

Copy php.ini-dist as php.ini
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini

Restart Apache22
/usr/local/etc/rc.d/apache22 restart

Test Php
echo “” >> /usr/local/www/apache22/data/test.php

Categories: FreeBSD Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: