WordPress on FreeBSD needs a working FAMP stack. Let start off the installation by setting up a FAMP stack first. Install the FAMP stack using this link.
The following procedure is tested on FreeBSD 10.2
Once the installation is over, install the extra packages needed for WordPress to work with Apache, MySQL and PHP.
pkg install php56-mysqli php56-curl php56-zlib
Create a database that would be used by WordPress application and grant all privileges to appropriate user.
mysql -uroot -p mysql> create database wordpress; mysql> GRANT ALL ON wordpress.* TO "wpuser"@"localhost" IDENTIFIED BY "wppassword"; mysql> FLUSH PRIVILEGES; mysql> quit
Download the latest WordPress package from the internet.
fetch https://wordpress.org/latest.tar.gz
Extract the package to the present folder.
tar -xzvf latest.tar.gz
Copy the files to /usr/local/www/apache24/data/ directory.
cp -r wordpress/* /usr/local/www/apache24/data/
Once the files are copied change directory to /usr/local/www/apache24/data/ and create a file wp-config.php from wp-config-sample.php.
cp wp-config-sample.php wp-config.php
Now edit the file wp-config.php and make the changes as follows.
define('DB_NAME', 'wordpress'); .... define('DB_USER', 'wpuser'); .... define('DB_PASSWORD', 'wppassword');
Change the ownership of all the files in this folder to ‘www’ user and ‘www’ group.
chown -R www:www .
Restart Apache server.
/usr/local/etc/rc.d/apache24 restart
Now load the WordPress application in your browser using the following URL, replace with your IP.
http://<ip-address>/