Yes, as long as your server meets the standard requirements. One FreeBSD user contributed these notes:
- to enable php4:
cd /usr/ports/www/mod_php4
make install clean - to enable sessions
cd /usr/ports/www/php4-session
make install clean - to enable mysql support
cd /usr/ports/databases/php4-mysql
make install clean - finally to get preg_match to work
cd /usr/ports/devel/php4-pcre
make install clean