Saturday, March 5, 2016

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

Tuesday, September 8, 2015

Google Trends Screensaver on Mac AND Windows

Here's a quick "how to" on how to display Google Trends data as a screensaver on both Windows and Mac operating systems.



Windows:
(tested on Windows 7... give it a test on Windows 8 & 10 and lemme know how it goes!)
1. Download the web-page-screensaver file from GoogleCode.com
2. Copy or Move the file into the c:\Windows\System32 folder
You may see the UAC pop-up... click Continue



















3. Screensaver menu > Settings > url to:
https://www.google.com/trends/hottrends/visualize?nrow=5&ncol=5












Mac:
(tested on Mac OSX 10.10.5)
1. Browse to URL: https://www.google.com/trends/hottrends/visualize?nrow=5&ncol=5
Click Download in the upper right of the screen











1a. Or download the DMG file directly
2. Open file GoogleTrendsScreensaver.dmg
3. Follow the instructions from there.

Friday, August 7, 2015

Installing Webmin on Ubuntu 14.04



Update Sources List:
sudo nano /etc/apt/sources.list
Add the following lines to the bottom of the file:
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
Add Webmin's GPG key to trust their repository:
wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add -
Update Package Lists:
sudo apt-get update
Install Webmin with apt-get:
sudo apt-get install webmin -y
Login to Webmin:
https://server_IP:10000
Enjoy!

Monday, May 25, 2015

Inherit the Earth

What does "meek" really mean?

According to Webster, it means "enduring injury with patience and without resentment"

Yes.

But it is in the awareness of our weaknesses and injures, that make us strong.

Being deliberately conscious of the path that brought us to where we are in the moment, is like shining a light into a dark room.

Seeing objects in a previously dark room help prevent us from tripping and falling over them.

Future Suffering prevented.

It also helps us define who we are in relation to the experiences of our lives.

When we shine a light into a dark room, it becomes easier to understand that a chair in that room does not define us. 

It is a chair. 

If we don't see the chair, it can become quite dangerous.

Knowledge of these objects is enlightenment.

Saturday, February 21, 2015

Once in a While

====================================
Hello folks.
The following post is based on a comment I wrote during a Hangout On Air a few weeks ago.
Mostly, I'm reposting it here for my own selfish note-keeping purposes.
So, if you gain something from it, awesome.
If not, no big deal.
====================================

Ya know?
Artist: Beth Cavener
Piece: I am no one.
www.followtheblackrabbit.com

Sometimes I have a tendency to,
Share my heart on my sleeve,
Maybe a little too much in both cyber & meatspace.

Unfortunately, I think it backfires on me sometimes.

Seems that sometimes I may come across
As a little intense and off putting,
Because my vulnerabilities are seen by some,
As a sign of weakness,
Or lacking confidence,
Or being needy,
Or maybe just a total nut case.

Then I get the impression that
People want to run the other way,
As if they've accidentally opened a pretty box,
Only to discover a diseased and dying creature.
Fearing the worst.

But once in a while,
Someone opens the box,
And discovers their own reflection.
That my cuts & bruises are their own.
They realize that those,
Broken,
Twisted,
And gnarly,
Branches that we share,
Are what makes the forests and mountains,
Mighty and beautiful.
And together we provide shelter and sustenance
To the delicate flowers deep within.

On the other hand,
It's possible that I'm completely insane
And no one really sees themselves in Me at all.

Sunday, February 1, 2015

If Less Is More, Nothing Is Everything



1. Promise Nothing
Just do what you most enjoy doing.
Hidden benefit: You will always over-deliver.
2. Offer Nothing
Just share what you have with those who express an interest in it.
Hidden benefit: Takes the pressure off of wanting other people to see you as valuable or important.
3. Expect Nothing
Enjoy what you already have. It’s plenty.
Hidden benefit: You will realize how complete your life is already.
4. Need Nothing
Just build up your reserves and your needs will disappear.
Hidden benefit: You boundaries will be extended and filled with space.
5. Create Nothing
Just respond well to what comes to you.
Hidden benefit: Openness.
6. Hype Nothing
Let quality sell by itself.
Hidden benefit: Trustworthiness
7. Plan Nothing
Take the path of least resistance.
Hidden benefit: Achievement will become effortless.
8. Learn Nothing
Let your body absorb it all on your behalf.
Hidden benefit: You will become more receptive to what you need to know in the moment.
9. Become No One
Just be more of yourself.
Hidden benefit: Authenticity.
10. Change Nothing
Just tell the truth and things will change by themselves.
Hidden benefit: Acceptance.