web publishing magazine

Security support for PHP 5.6 and PHP 7.0 expires

The final support end of PHP 5.6 and 7.0 has been reached. Admins should upgrade to a supported version.

No more security updates: Security support for PHP 5.6 expires on December 31, 2018. For PHP 7.0 this was already the case on December 03. Website admins should act immediately and install a current PHP version. The problem is that lots of websites are still using PHP versions that are no longer in security support. According to the statistics service W3Techs, almost 80 percent of all websites currently use PHP. Version 5 is still used in around 60 percent of these sites. But it is progressing: In October this was still the case with about 80 percent. For their statistics W3Techs evaluates among other things data of 10 million Websites, which come from the analysis service Alexa according to own data.

December 19, 2018 — Oliver

Xdebug with Visual Studio Code

If you work quite often with PHP, you will soon notice that debugging with the functions print_r() and var_dump() is quite difficult and do not always lead to the target. For this reason there is the PHP extension Xdebug. This PHP extension is already integrated into MAMP PRO and you only have to activate it by clicking a checkbox.

Now all that is missing is a nice visual presentation of the data provided by Xdebug. For example, you can use Visual Studio Code (VSC). For this editor there is an excellent extension “PHP Debug” by Felix Becker. To install, simply open the extension view in VSC and search for “PHP Debug”, click on the green “Install” button and your environment is ready.

Now you are not only informed about errors you made during programming, but you can also examine all variables and their values during the runtime of your PHP program by setting breakpoints. Only in this way it is possible to develop websites efficiently and professionally with PHP.

local/remote switch in your PHP code

If you develop your PHP application locally with MAMP PRO and then publish it on your live server, there will be some differences. One difference would be your MySQL access data, such as your user name and login. When you publish a WordPress installation, MAMP PRO automatically takes over these changes for you. But the world is not just WordPress. The following example shows how to define the credentials for your MySQL database to work both locally and remotely:

Of course, this technique is not limited to this example. You can use it whenever you need to.