You are currently viewing Migrate WordPress on FreeBSD from php5 to php7

Migrate WordPress on FreeBSD from php5 to php7

PHP7 offers performance improvements that anyone hosting WordPress site will want to enjoy.  Moving a B.A.M.P. install from php5 to php7 is simple enough.

First install the packages for php7:

  • pkg install mod_php70
  • pkg install php70-mysqli
  • pkg install php70-session
  • pkg install php70-ctype
  • pkg install php70-xml
  • pkg install php70-curl
  • pkg install php70-ftp

mod_php70 is the php7 module for apache.  We also need the mysqli package (don’t forget the “i”) otherwise we will get database connection errors.  Session handles sessions funnily enough.

Your not done yet even though your site may seem to work at this point.  ctype is used by jetpack, without this your jetpack dashboard won’t work.  I forgot why I need XML as I didn’t have a guide like this one to follow…  Finally if you use auto updates from within WordPress you need curl and ftp so you can download and install updates.

Now you have everything you need.  Time to enable php7 in the apache configuration in “/usr/local/etc/apache24/httpd.conf”

Remove php5 add php7:

  • LoadModule php5_module  libexec/apache24/libphp5.so  << remove this
  • LoadModule php7_module  libexec/apache24/libphp7.so << add this

Allow php to use the mysqli extension

  • Edit /usr/local/etc/php.ini
  • extension=php_mysqli.dll << remove the semi-colon (;) from the start of this line

Restart apache and you should now be running on WordPress on Apache 2.4 and php7 under FreeBSD.

 

This Post Has 2 Comments

  1. blakaboy

    What about the installation of wordpress itself?

    1. Karl

      Hi Blakaboy,
      Wordpress is just a zip file you can get from wordpress.org and unzip then point your webserver at it, nothing special about it.

      Do you have a specific question about the installation?
      //Karl

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.