News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
How to Install Custom PHP Extensions on Heroku
September 29, 2014 @ 14:24:56

The SitePoint PHP blog has a tutorial posted for the Heroku users out there showing you how to install custom PHP extensions on the service as a part of your deployment. Heroku is a platform-as-a-service hosting provider that allows for flexibility in the architecture of your systems and spin up/tear down to happen easily and on demand.

In this tutorial, we'll learn how to install custom extensions on Heroku. Specifically, we'll be installing Phalcon.

He walks you through creating an account on Heroku first and getting the Heroku toolbelt system installed for your operating system. He then starts in on the Phalcon (a C-based PHP framework) installation including all needed supporting packages/extensions. He uses the PHP buildpack and creates a shell script that is executed when the deployment happens. He includes the commands and configuration to handle the deployment and test the resulting installation.

0 comments voice your opinion now!
heroku tutorial custom extension phalcon deploy paas

Link: http://www.sitepoint.com/install-custom-php-extensions-heroku/

Lorna Mitchell:
Compiling PHP Extensions
August 29, 2014 @ 09:28:42

Lorna Mitchell has posted a quick guide to compiling PECL extensions to her site today. This is for those users on unix-based systems that might need to manually compile with some custom options (or may be working on your own extension and may just need to test it).

There are lots of reasons why you might like to compile your own PHP extensions. [...] I haven't seen a really approachable guide anywhere, we tend to speak of extensions in hushed tones, and actually it isn't particularly tricky so here is my quick how-to guide.

The process is relatively simple for those familiar with the command line and the steps involved in compiling software. There's some special PHP-only steps you'll have to take before compiling the code to make sure it's ready to be a PHP extension. Then it's up to the usual configure+make_make install to ensure the .so file is correctly generated.

0 comments voice your opinion now!
compile extension tutorial phpize module

Link: http://www.lornajane.net/posts/2014/compiling-php-extensions

SitePoint PHP Blog:
How to Install PHP Extensions from Source
June 30, 2014 @ 11:50:22

PHP extensions (from PECL) can be very handy when you need them. Unfortunately, not all distributions come with packages that will install them for you...this is where compiling comes in. On the SitePoint PHP blog Bruno Skvorc has posted a guide to compiling extensions from source to help you get started.

Sometimes it's hard to know which PHP extensions you'll need before you install PHP. In cases where you need to add extensions later on, you might get lucky and the extension could be in the repository of the OS you're using. [...] What if there's no such thing for other extensions, though? In this tutorial, we'll go through installing some custom extensions on Linux systems (and OS X - the process is nearly identical).

He uses a Laravel Homestead instance as a platform for his example and shows the compilation of the MongoDB for PHP driver. He walks you through the process of booting up the VM and getting the environment/required packages installed. He then shows the process for the installation of two different kinds of PHP extensions: internal and third-party. Finally he shows you how to update your configuration, load in the compiled extension and test it (in this case looking at the phpinfo() to ensure it's loaded).

0 comments voice your opinion now!
install extension source compile tutorial introduction

Link: http://www.sitepoint.com/install-php-extensions-source/

Hannes Magnusson:
I have a dream
May 26, 2014 @ 09:23:54

In his latest post Hannes Magnusson describes his "dream" about a future for PHP where things like upgrading and working with extensions would be simpler, faster and more manageable.

Today we will revolutionize PHP. We will make it easier to upgrade the things you care about. We will make it easier to not upgrade things you don't want to upgrade. We will make it easier to distribute your extensions. We will make it easier to release according to your own schedule. We will make it easier to add functionality. We will make it easier to work. Ok, today is a white lie here maybe... I haven't actually implemented this, but bare with me here for a second.

With the introduction and huge growth of Composer, the PEAR package manager is fading in popularity and is slowly being abandoned. Unfortunately, it's still the primary mechanism for deploying and installing PHP extensions (PECL packages). He talks about some of his recent experience reviving a package and issues he had around the use of the packaging manager. He proposes the creation of a new "pecl install" tool - a package manager dedicated to PHP extensions, decoupled from PEAR.

The manager would just install basic PHP then leave it up to you to pick which features you need from there. The idea is still in its early stages, but the idea has taken roots and plans are being worked through to see if this idea will work for the future of the language.

0 comments voice your opinion now!
pear pecl future language package manager extension

Link: http://bjori.blogspot.com/2014/05/i-have-dream.html

Mathias Verraes:
Final Classes
May 13, 2014 @ 09:48:43

Mathias Verraes has posted some of his thoughts about using "final" in classes and what kind of impression it gives about your code.

I make all my classes final by default. I even configured the templates in my IDE prefix new classes with 'final'. I've often explained my reasoning to people. A blog post is in order! A guiding principle here is Clarity of Intent. [...] The reason we need clean code, is not for the compiler. It's to help our fellow developers, third parties, and even ourselves in six months time, understand the purpose and the design of our system.

He relates this concept of clean code and clarity back to the SOLID development principles, specifically the "Open/Closed Principle". This principle states that software should be open for extension but not for modification. It suggests that providing a stable, known API is a responsibility of the developer and using things like callbacks and listeners is a better way to extend. He gets into a bit more PHP-specific issues around using "final", including the difficulties that it can cause during testing.

0 comments voice your opinion now!
final class inheritance extension solid openclosed principle

Link: http://verraes.net/2014/05/final-classes-in-php/

SitePoint PHP Blog:
Getting Started with PHP Extension Development via Zephir
April 09, 2014 @ 10:26:22

The SitePoint PHP blog has posted an introductory tutorial helping you get started with extension development with Zephir, a language that aims to make extension development easy and fast.

This tutorial will explain how to create a PHP extension using a new language: Zephir, which is similar to C and Fortran. You can download the full source code from github. We've touched on the concept of Zephir before, so if you're interested in getting a broad overview, see our previous articles. Zephir can be looked at as a hybrid language that lets you write code that looks like PHP, but is then compiled to native C, meaning you can create an extension from it and come away with very efficient code.

He starts with a list of dependencies you'll need to get an extension compiled and working with Zephir including the gcc compiler and json-c. He shows you how to install Zephir from Github and update your path to make the executable available. As his example extension, he creates a tool that can calculate the result for the time-dependent Schrödinger equation (don't worry, the complete Zephir code for the extension is included in the tutorial). He includes the commands to initialize the Zephir project, code for the various classes involved and the expected output from the compilation. Finally, he includes a bit of PHP code to test out the newly built extension and its output.

0 comments voice your opinion now!
tutorial zephir extension language compile equation

Link: http://www.sitepoint.com/getting-started-php-extension-development-via-zephir/

SitePoint PHP Blog:
PHP Extension Development with PHP-CPP Object Oriented Code
April 08, 2014 @ 09:11:17

The SitePoint PHP blog has posted the second part of their look at the PHP-CPP tool and how to use it for developing PHP extensions. In this second part of the series Taylor Ren builds on what was learned in part one and talks more about the OOP features of the tool.

In this part, we further elaborate its OO features. We will mimic a complex number (in the form of 3+4i) class to demonstrate some more useful and powerful sides of the PHP-CPP library.

He walks you though a few changes to the environment files (the .ini configuration file and the Makefile) to set things up. He then gets into the C++/PHP constructor and getters and setters for private class variables, much like PHP's __get and __set. His example shows a set of methods that do some mathematical calculations including one to show the result in a "more friendly way". He includes the code for registering these functions and, finally, the steps to compile, install and test the extension.

0 comments voice your opinion now!
phpcpp extension development part2 series oop code

Link: http://www.sitepoint.com/php-extension-development-php-cpp-object-oriented-code

Liip Blog:
HHVM and New Relic
March 28, 2014 @ 09:04:00

In this new post to the Liip blog Christian Stocker talks about how they use the popular application and server monitoring service New Relic with the HHVM (despite no official support).

As discussed in one of my last blog posts, we really like New Relic for performance metrics and use it a lot. Unfortunately there isn't an extension for HHVM (yet) and HHVM is becoming an important part in our setup. But - a big great coincidence - New Relic released an Agent SDK and with that, an example extension for HHVM and WordPress. That was a great start for me to get behind the whole thing.

He talks about writing a HHVM extension and includes an example of the implementation. Christian also talks about the challenges around profiling data and finding out where the requests "spend their time" in the execution. There's two solutions he suggests, but they each have their tradeoffs (a recompiled/patched version or a performance hit). He provides the extension they've built in this github repository.

0 comments voice your opinion now!
hhvm newrelic patch extension support agentsdk

Link: http://blog.liip.ch/archive/2014/03/27/hhvm-and-new-relic.html

SitePoint PHP Blog:
Getting Started with PHP Extension Development via PHP-CPP
March 27, 2014 @ 12:15:08

On the SitePoint PHP blog today there's a new tutorial from Taylor Ren showing you how to get started with PHP-CPP for creating PHP extensions. PHP-CPP is a C++ library that makes it simpler (and faster) to create PHP-specific extensions.

In your dealings with PHP, you may come to consider writing a PHP extension yourself. [...] When it comes to choosing a tool to build PHP extensions, we see two different approaches: use more pro-PHP semantics, like Zephir or use more pro-C/C++ semantics, like PHP-CPP, which will be addressed in this article. For me, the main drive to select the second approach is simple: I started my programming hobby with C/C++, so I still feel more comfortable writing those lower level modules in C/C++. PHP-CPP's official site gives a few other reasons to do so.

He walks you through the installation of the library (for now, just a git clone) and getting the needed environment set up to be able to compile and test out the extension. He helps you set up the "skeleton" files for the extension, including some sample content. He includes code for a typical "Hello World" example extension as well as its use in a sample PHP script.

0 comments voice your opinion now!
tutorial extension introduction phpcpp library beginner

Link: http://www.sitepoint.com/getting-started-php-extension-development-via-php-cpp

SitePoint PHP Blog:
Installing PHP Extensions on Nitrous.io
March 03, 2014 @ 11:45:22

On the SitePoint PHP blog Bruno Skvorc has posted a new tutorial showing you how to get PHP extensions installed on Nitrous.io, an online environment combining an IDE and PaaS hosting.

Inspired by a comment on my previous article, I realized Nitrous was still a bit too complicated to customize properly. In this tutorial, we'll glide through installing cURL and Phalcon on a Nitrous.io PHP box.

He continues on from his previous article and shows how to detect cURL support and how to build it from the PHP source into an extension. He helps you get the source for the older PHP version Nitrous.io has installed and the commands you'll need to build the extension. With it installed and enabled in the php.ini, he also installs the Phalcon extension.

0 comments voice your opinion now!
nitrousio tutorial install extension curl phalcon compile

Link: http://www.sitepoint.com/installing-php-extensions-nitrous-io


Community Events





Don't see your event here?
Let us know!


tool series podcast install opinion laravel interview introduction community update version package release voicesoftheelephpant framework library symfony language composer security

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework