Categories Industry InsightsPerformance Monitoring

Choosing your own Adventure with PHP

PHP Today

Let’s get the stats out of the way. For websites and web applications, PHP (as of writing) is used two to four times more than the next most popular language. It is ubiquitous on the modern web. While Facebook is often quoted as the site that proves the worthiness of PHP, there are millions of other sites that use PHP like Wikipedia, Ars Technica, Wired, Amazon, Fox, and many more. PHP is pervasive and it is the 44 million site elephant in the room. 

For years the much-maligned, but often used, language has been a starting point for new developers looking for server-side scripting while simultaneously a digital scratching post for veteran engineers. The fact remains that PHP is used heavily on WordPress, Drupal, Zend, CodeIgniter and other site builders. It has an internet presence of over 10.5 billion sites on Google compared to Ruby and Java which have just over 800 million combined. PHP is infinite, PHP is eternal.

Let’s agree that this will not be a post arguing for or against PHP. Let us even forget anything about PHP earlier than version 5.0. Done? Great. Let’s instead focus on the common cases that lead to the need for PHP monitoring.

What Reader are you?

Because of its popularity PHP users can often be segmented into two groups. Those just starting out and those who have used it through a framework in the past.

>> It’s dangerous to go alone, take this! (if you’re newer to PHP code)

>> If you need a better way to monitor your PHP site, go here.

Starting Out

Due to a co-starring role in the LAMP and LEMP stacks, PHP scripts are everywhere and offers a simple workflow for many web hosting environments. It is a server-side scripting engine that’s interpreted instead of compiled, easily embeds in HTML, and offers simple database integration. It also includes an object-oriented model, anonymous namespaces, and traits. Simply, PHP is a mature language with loads of features.

One caution is that the internet is full of old tutorials. Updated ones do exist, but if the post was from before 2010, references a version number less than 5, or introduces “the brand new CLI” move on. Opposed to newer languages, most questions new PHP developers have are already answered and documented on sites like Stack Overflow which makes it much easier to get past early blockers in PHP scripts. Direct integration with Apache, IIS, and simple connection to MySQL also make it very accessible to new users.

>> Congratulations on your newbie status, keep reading anyway champ!

Existing Sites

For existing sites or blogs using PHP it’s often hard to justify time and money spent migrating to new platforms. This leads to management of heterogenous platforms as new sites are created with new technologies and older ones that at least function get left behind. To determine site, delivery and database performance in production there is often a desire to maintain these legacy sites with a singular tool. Ideally this tool tells you the whole story for all of your disparate platforms. Application performance monitoring (APM) allows for development and operations to focus team attention to the worst-performing components.

In order to effectively decide when and where to update your existing infrastructure application performance monitoring will need to allow deep integration with every layer of your application stack across multiple hosts. It should, as a minimum, offer code-level insight to allow bug targeting, strong visualization to identify latency spikes in the PHP layer, and expose query information to allow for better PHP-to-database, memcache or redis integration. 

>> I loved these books!

That Portion of the Adventure you can’t Avoid

For either case, new or old sites often use frameworks to implement PHP. Leaders in the framework space like Drupal, WordPress, and CodeIgniter allow rapid deployment of dynamic websites to customers and readers. Frameworks are a significant recent that PHP is still relevant and powerful. But PHP code can, like any other language, lead to significant bottlenecks and force developers to determine if performance issues reside in the PHP script, the database query, or somewhere else. AppNeta’s Application Performance Monitoring solutions provide unique capabilities that enable you to reduce the mean time to resolve performance issues.

Whether you’re new to PHP or just responsible for finding out why it’s not working on legacy sites, AppNeta can help you by offering PHP monitoring software with TraceView. TraceView installs as a PHP extension and requires no code changes to deliver error reporting, code, and query insight on top of actionable visualization.

Join over a third of our customers that are using TraceView to monitor complex applications powered by PHP. Sign up for a free trial today!

Alec Pinkham: Mainer, Brown grad, and general tech junkie, Alec shifted to software after a mechanical engineering education and working in industrial automation solutions before moving to the cloud with AppNeta. Hiker, skier, homebrewer, and ultimate frisbee player - ideally at the same time.