Skip to content

PHP Articles

Jun 04

Create PHP Composer Package

Composer is an important tool in PHP development for dependency management. It allows for applications to easily use and share libraries while maintaining version control. This is a simple tutorial on how to make packages which can be shared with and used by other developers. The tutorial follows a packge I created. Folder Structure Typically […]

Jun 03

InfluxDB UDP

InfluxDB is a database for storing time series data in a distributed environment. With zero dependencies and a robust querying language, InfluxDB is just beginning to grow its presence in the open source database market. One great use case for InfluxDB is storing application analytic data. With the ability to communicate with the server using […]

Dec 01

Hacklang Async Processing

One of the frustrations in working with PHP is the synchronous, blocking, behaviour of the language. There are PHP extensions, such as pthreads that offer quasi PHP threading; however, that requires extra considerations such as server setups, locking, shared state, etc., and is often times omitted from development discussions due to overhead/learning curve of writing […]

Nov 26

Hacklang Generics

Facebook released Hacklang in early 2014 for use with HHVM, and has since announced that almost their entire code base has been ported from PHP to Hack. Hack interoperates seamlessly with PHP code and offers various enhancements, such as static typing, collections, asynchronous processing, etc. As a PHP developer migrating to Hack, the language was […]

Nov 01

Ubuntu HHVM Install

Facebook’s HHVM is a Virtual Machine which runs PHP, and Hack Lang, through a just-in-time (JIT) compiler to “achieve superior performance” in executing PHP code. From HHVM’s website: Rather than directly interpret or compile PHP code directly to C++, HHVM compiles Hack and PHP into an intermediate bytecode. This bytecode is then translated into x64 […]

Sep 17

PHP Composer Autoloading

Composer is PHP’s dependency manager tool. Composer allows you to specify libraries that are need for a project, and will automatically include those libraries along with their dependencies. Composer also allows you to create your own packages and share them via the Packagist website. Even when working on projects in which you are not using […]

Sep 12

PHP 5.5 with Opcache and APCu

As of PHP 5.5 Zend Opcache is a part of the core PHP distribution. PHP code is an interpreted language and is therefore parsed and compiled into opcode on every request. An Opcache allows the opcode to be stored in shared memory in which subsequent requests will be able to pull from, opposed to having […]

Feb 15

Analyzing PHP Code with Xdebug

Xdebug is a PHP extension that allows you to profile and debug your PHP code. It enables you to get detailed breakdowns of memory usage, function call costs, code efficiency, etc. on both your PHP scripts and HTTP page loads. Xdebug offers many unique features and it’s an invaluable tool for analyzing code during the […]

Jan 22

PHP Performance with APC Opcache

PHP is an interpreted language, opposed to a compiled language, meaning that each time a PHP file is requested it must be parsed and interpreted. By using an opcode cacher, such as APC, you are allowing compiled PHP code to be stored in shared memory. Thus when files are requested multiple times they do not […]

Jan 13

Website Performance with Browser Caching: Part 2 – Dynamic Files

As outlined in the previous article, browsers will cache static files by default. However, HTML files and scripts, PHP in this case, do not cache by default because they do not return ETag or Last-Modified values. Also, scripting files are used to generate dynamic content, so caching such requests would be counter productive as the […]

Blog Powered By Wordpress
<<< Prev