Book Image

Mastering PHP 7

By : Branko Ajzele
Book Image

Mastering PHP 7

By: Branko Ajzele

Overview of this book

PHP is a server-side scripting language that is widely used for web development. With this book, you will get a deep understanding of the advanced programming concepts in PHP and how to apply it practically The book starts by unveiling the new features of PHP 7 and walks you through several important standards set by PHP Framework Interop Group (PHP-FIG). You’ll see, in detail, the working of all magic methods, and the importance of effective PHP OOP concepts, which will enable you to write effective PHP code. You will find out how to implement design patterns and resolve dependencies to make your code base more elegant and readable. You will also build web services alongside microservices architecture, interact with databases, and work around third-party packages to enrich applications. This book delves into the details of PHP performance optimization. You will learn about serverless architecture and the reactive programming paradigm that found its way in the PHP ecosystem. The book also explores the best ways of testing your code, debugging, tracing, profiling, and deploying your PHP application. By the end of the book, you will be able to create readable, reliable, and robust applications in PHP to meet modern day requirements in the software industry.
Table of Contents (24 chapters)
Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
16
Debugging, Tracing, and Profiling

Working with MySQL


MySQL is an open source RDBMS that has been around for over 20 years now. Originally developed and owned by the Swedish company MySQL AB, it is now owned by Oracle Corporation. The current stable version of MySQL is 5.7.

Some of the key strengths of MySQL can be outlined as follows:

  • Cross-platform, runs on server
  • Can be used for desktop and web applications
  • Fast, reliable, and easy to use
  • Good for small and large applications
  • Uses standard SQL
  • Supports query caching
  • Supports Unicode
  • ACID compliance when using InnoDB
  • Transactions when using InnoDB

Installing MySQL

Assuming we are using the fresh Ubuntu 16.10 (Yakkety Yak) installation, the following steps outline how we can set up MySQL:

  1. To install MySQL, we execute the following console commands:
sudo apt-get update
sudo apt-get -y install mysql-server
  1. The installation process triggers a console GUI interface that asks us to enter a root user password:
  1. The provided password needs to be repeated for confirmation purposes:  
  1. Once the installation...