mysqli get_result alternative | upgrade debian 6 to 7 | database heavy php mysqli oop optimize | testing


Debian 9 Stretch RC3 Dedicated Web Server Setup Step by Step. Time for PHP7 and MariaDB

Debian 9 (Stretch) release candidate 3 (RC3) is available since April 10th, 2017. Debian 9 RC3 is still a "testing" release (not recommended for production servers). Which is the release date of stable Debian 9? "When it's ready" is the Debian answer. But, as Full freeze announced on February 5th, 2017 we can suppose that the final stable release will be available in about six months (mid of 2017). Please, note that no major differences are added after Full freeze (only bug fixes).

There are two very important changes in Debian 9 (Stretch):

So, it is crucial to test your projects, probably based on php 5.* and MySQL, in order to use Debian 9 official release in your server.

For this purpose, I setup Debian 9 RC3 in a virtual machine using Virtualbox. As MariaDB is a drop-in replacement for MySQL, moving to MariaDB seems to be easy. Use mysqldump to export your databases and then import them to MariaDB. You may encounter some problems moving to php7, depending on your php code. But generally, the migration is not so difficult. Below I describe my experience.

Easily Create a Bootable USB with Multiple ISO Images

I want to keep some of my favorite (Linux) distributions (for workstations and server machines) and some useful Rescue CDs inside a USB stick.

Some of the available tools to create a bootable USB are:

Although I am a Linux user, my personal choice is WinSetupFromUSB (a Windows application). Because it is simple and it works(!). It supports a lot of ISO sources.

WinSetupFromUSB is free for personal and commercial use. Read more details about its License here.

I created my multiboot USB in Windows 10 using Virtualbox. My USB is a Kingston DataTraveler R3.0 G2 USB 3.0 64GB.

How To Setup a Workstation Computer With Xubuntu Desktop 16.04 LTS Step by Step

Xubuntu is the Ubuntu flavor with Xfce. Xfce is a lightweight desktop, fast, stable, simple and user friendly. Xubuntu is Free and Open Source. It is an excellent choice for any desktop computer, even more for those with older hardware or lower specifications. A nice environment with great support for sound, peripherals, removable devices and any kind of networking (wired, wi-fi etc) "out of the box". Moreover, a lot of free (usually Open Source) applications are available to create your working environment. Version 16.04 LTS provides software updates for 3 years (LTS = Long Term Support). In short, it contains everything you need in a modern desktop.

Xubuntu installation performed on a 7 years old Fujitsu Siemens AMILO Notebook Xi 3650.

How To Setup A Workstation Computer With Ubuntu 16.04 Desktop Step by Step

After four years with Arch Linux in my workstation computer, I switched back to Ubuntu desktop (for one more time).

Arch Linux is an amazing rock solid Linux distribution and it offers the best documentation by far. However, I moved to Ubuntu 16.04 LTS (Long Term Support) mainly for these reasons:

  1. I want to spend less time to manage my workstation computer (updates are "pain" in Arch, but very easy in Debian/Ubuntu).
  2. I have transferred ALL MY DATA to cloud during last 12 months (basically in Google Drive). I am working many hours with Android in mobile devices, so my desktop workstation can have a more simple setup.
  3. I have transferred ALL MY SERVER APPLICATIONS (apache, php, mysql, postgres) to a Debian VPS, so my desktop workstation can have a more simple setup.

Ubuntu desktop seems to be much more mature and stable in version 16.04 (latest LTS version). The final result is a Free and Open Source workstation environment, which can meet the requirements of the vast majority of users.

How To Setup And Configure PhpStorm on Ubuntu

PhpStorm is my favorite PHP IDE. It is a commercial Java application from Jetbrains. It compines performance with a feature rich interface and it has an excellent Git integration. Very good documentation and support.

I have tried many other (excellent) IDE (Integrated Development Environment) for web development from time to time. HTML, CSS and JavaScript as front-end and mainly PHP for back-end (secondarily Perl, Python). I also want to write Bash scripts with the same tool.

Some of them are:

I don't use IDEs which provides "visual" tools. I prefer to write code.

I use Git as VCS (version control system). My code is hosted on Github (and Bitbucket).

I use Github Issues to track tasks and bugs.

How To Setup And Configure Google Chrome on Ubuntu 16.04

Google Chrome was released in late 2008 for Microsoft Windows. The first thing everyone said about the new browser was that it was very fast. Google released the majority of source code (not all components) as the Chromium open-source project, so the Open Source version of Chrome is Chromiun browser.

About two years later (in mid-2010) Google released the first stable version for Linux. Since then I am a Chrome user (on my Linux Desktop and later on my Android mobile devices). Because Chrome is fast, offers a great Javascript engine and all Google services I use (Gmail, Google Drive and more) are supported better with Chrome.

One of the best features of Chrome (actually, only for web developers) is Chrome Developer Tools (web authoring and debugging tool).

Google Chrome has very regular updates. See version history here. Today Google Chrome has a 63% worldwide usage share of web browsers as a desktop browser. Source: StatCounter Global Stats - Browser Market Share

How To Setup And Configure Mozilla Firefox on Ubuntu 16.04

I cannot imagine my computer or mobile device withour Mozilla Firefox. It sounds strange, but Firefox is not my default browser. I am a Chrome user. Because Chrome is fast, offers a great Javascript engine and all Google services I use (Gmail, Google Drive and more) are supported better with Chrome. Additionally, Chrome has its own built-in Flash plugin, which updated with each Chrome update.

However, everytime I need to check a web page as a web developer, I use Firefox. Because Firefox is the most reliable browser and the most compatible with W3C standards. Additionally, Java plugin will run in Firefox, but it is not supported in Chrome anymore.

Mozilla Firefox is installed by default on Ubuntu 16.04 Here is how I configured my Firefox:

  • menu → Preferences
  • menu → Add-ons

How To Setup Java on Ubuntu 16.04

Java is a general-purpose computer programming language which is used from many software applications or websites.

Java is available from the Open Source project OpenJDK and freely available from Oracle.

Some Java applications require Oracle Java. This is my case. Here I describe the available solutions.

How To Setup Samba on Ubuntu Workstation

If you want to be connected with your workstation either from command line or your File Manager (e.g. from another computer in your LAN, Linux, Windows or Mac), install Samba.

According to Official Samba Guide:

Samba is software that can be run on a platform other than Microsoft Windows, for example, UNIX, Linux, IBM System 390, OpenVMS, and other operating systems. Samba uses the TCP/IP protocol that is installed on the host server. When correctly configured, it allows that host to interact with a Microsoft Windows client or server as if it is a Windows file and print server.

Please, note that this guide concerns Local Networds and NOT public servers. For advanced configuration, read carefully the Official Samba How-To.

Manage Your Passwords With KeePass in Linux And Android

KeePassX password manager is the first application I open after my Linux workstation bootup and the last I close before shutdown. It is strongly recommended to install and use a password manager:

  • To create (really strong) passwords. Strong password is not necessary the password which contains many special characters, but the password which contains REALLY RANDOM characters. The only way to achieve it, is to use a password manager with a password generator.
  • To store your passwords securely
  • Never Reuse Passwords! Most of us have accounts in many online services and tend to use the same password. This is a big mistake and can be avoided by using a password manager.

My personal choice is:

  1. KeePassX on Linux desktop
  2. KeePass2Android on Android devices
  3. Sync them all with Dropbox
Previous posts