Categories
PHP Web

From Scratch PHP Project with the PHP Built-in Web Server

If you are starting a PHP project from scratch you will probably use the PHP built-in web server during development. This tutorial follows the folder structure of a composer based project: Now, let us create a script that can serve as the router for PHP’s built-in web server. Save a file named router to the […]

Categories
Apps PHP Web

Tools for Sending, Developing, and Testing PHP Application Email

When sending emails through PHP on a local development computer I use MailHog. MailHug is a free tool that traps all of the emails sent from your local application and provides an interface to view those emails. Emails trapped by MailHog are not sent to your email recipient making it the perfect tool for testing. […]

Categories
PHP Web

What time is it?

A helpful collection of resources about working with timezones for developers. Watch Read Programming time, dates, timezones, recurring events, leap seconds… everything is pretty terrible. PHP Conversion Snippet Carbon is a time and date package for PHP. I use this snippet with Carbon to convert a user-provided date to UTC. PHP Timezone Bootstrap When I’m […]

Categories
Performance PHP SQL Web

Raw PHP and MySQL Eager Loading

Working with complicated and joined data sets can be tricky for MySQL database performance. For example, What if you need to load multiple authors and their books from a database. How would you work around the N+1 problem and avoid unnecessary queries to the database without an expensive join statement? The answer is quite simple. […]

Categories
PHP Servers Web

Installing Xdebug for PHP7

Xdebug deepens debugging PHP apps and websites to a level you can’t receive from the manual process of using code level var_dump(). Setup To install Xdebug for PHP7 on Ubuntu you will need to do so manually. Ubuntu 15 and lower will not come with a package for PHP7 or its xDebug counterpart. First, be […]