Upgrade from PHP5 to PHP7.0 (Debian 8 Jessie, Apache2, mySQL & WordPress 4.4.2)

Upgrade from PHP5 to PHP7.0 on Debian 8 Jessie with Apache2 and mySQL (for WordPress)

Generic notes on a recent upgrade I made on a WordPress installation that's running on a Google Compute Engine virtual machine.

This also assumes use of:
WordPress Enfold Theme
WordPress myCred Plugin


Install PHP7 & dependencies: ssh user@domain.com
Upgrade from PHP5 to PHP7.0 on Debian 8 Jessie with Apache2 and mySQL (for WordPress)
Install and Config
sudo nano /etc/apt/sources.list
deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all
wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
sudo apt-get update
sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-cgi php7.0-fpm php7.0-mysql php-mysql mcrypt php7.0-mcrypt -y
Personal Tweaks:
sudo nano /etc/php/7.0/apache2/php.ini
post_max_size = 100M
upload_max_filesize = 100M
memory_limit = 256M
Enable PHP7.0 Apache2 Module
sudo a2dismod php5
sudo a2enmod php7.0
sudo service apache2 restart
sudo service mysql restart
Check version of PHP:
sudo nano /var/www/html/info.php
<?php phpinfo()?>
http://domain.com/info.php
Don't leave your info file hangin' around now
sudo rm /var/www/html/info.php
php -v


Enable Debugging & Watch Debug Log: ssh user@domain.com
sudo nano /var/www/html/wp-config.php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
tail -f /var/www/html/wp-content/debug.log


FIX PHP Fatal ERRORS:  Uncaught Error: Function name must be a string
1
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-htmlhelper.php

// $output .= $this->$element['type']( $element ); LINE 203 AND LINE 222 OR 223
$output .= $this->{$element['type']}( $element );
ENFOLD
2
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-style-generator.php

// $this->output .= $this->$rule['key']($rule)."\n";
$this->output .= $this->{$rule['key']}($rule)."\n";
ENFOLD
3
sudo nano /var/www/html/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/html-helper.class.php

// $output .= self::$element['type']($element, $parent_class); LINE 130 AND LINE 146 OR 147
$output .= self::{$element['type']}($element, $parent_class);

// $output .= self::$element['data']['save_to']($element);
$output .= self::{$element['data']['save_to']}($element);
ENFOLD
4
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-form-generator.php

// $this->$element['type']($element_id.$this->id_sufix, $element);
$this->{$element['type']}($element_id.$this->id_sufix, $element);
ENFOLD
5
sudo nano /var/www/html/wp-content/plugins/mycred/addons/stats/myCRED-addon-stats.php

// $this->$method[1]( $current );
$this->{$method[1]}( $current );
MYCRED



FIX Deprecated Constructor WARNINGS
6
sudo nano /var/www/html/wp-content/themes/enfold/config-layerslider/LayerSlider/wp/widgets.php
//      function LayerSlider_Widget() {
       function __construct() {
ENFOLD > LayerSlider_Widget
7
sudo nano /var/www/html/wp-content/themes/enfold/includes/helper-responsive-megamenu.php
//              function avia_responsive_mega_menu($options = array())
               function __construct($options = array())
ENFOLD > avia_responsive_mega_menu
8
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-superobject.php
//              public function avia_superobject( $base_data )
               public function __construct ( $base_data)
ENFOLD > avia_superobject
9
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/wordpress-importer/avia-export-class.php
//              function avia_wp_export($avia_superobject)
               function __construct($avia_superobject)
ENFOLD > avia_wp_export
10
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-database-option-sets.php
//              function avia_database_set($avia_superobject = false)
               function __construct($avia_superobject = false)
ENFOLD > avia_database_set
11
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-htmlhelper.php
//              function avia_htmlhelper($avia_superobject = false)
               function __construct($avia_superobject = false)
ENFOLD > avia_htmlhelper
12
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-metabox.php
//              function avia_meta_box($avia_superobject)
               function __construct($avia_superobject)
ENFOLD > avia_meta_box
13
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-adminpages.php
//              function avia_adminpages(&$avia_superobject)
               function __construct(&$avia_superobject)
ENFOLD > avia_adminpages
14
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-breadcrumb.php
//      function avia_breadcrumb($options = ""){
       function __construct($options = ""){
ENFOLD > avia_breadcrumb
15
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-form-generator.php
//              function avia_form($params)
               function __construct($params)
ENFOLD > avia_form
16
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/avia_shortcodes/shortcodes.php
//      function avia_shortcodes() {
       function __construct() {
ENFOLD > avia_shortcodes
17
sudo nano /var/www/html/wp-content/themes/enfold/framework/php/class-megamenu.php
//              function avia_megamenu()
               function __construct()
ENFOLD > avia_megamenu

Comments

Popular Posts