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