News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Dan Barrett:
Setting Up a LAMP Stack on Debian - My Way
January 06, 2014 @ 11:58:46

Dan Barrett has written up an excellent guide to setting up a LAMP stack on Debian from the ground up. It includes all the commands, configuration changes and screenshots of the interface you'll need.

Setting up a test environment can be a tricky thing when you compile PHP from scratch. As others have mentioned in the past, installations from Aptitude (and the like) lag behind which can quickly put your test environment out of date. Pulling inspiration from Juan Treminio and Brandon Savage, who both wrote excellent articles on setting up PHP from scratch. I like to keep my options open when developing which left both of those articles lacking a few features and extensions that I'd like to have bundled with PHP.

He guides you through a (detailed) process to get the following set up and running:

  • Debian itself (GUI installer)
  • Network configuration
  • Installation of Apache
  • both PostgreSQL and MySQL
  • Other software including ImageMagick, GraphicsMagick
  • PHP 5.5 (with several extensions of its own)
0 comments voice your opinion now!
lamp stack debian mysql postgresql configure install tutorial

Link: http://www.yesdevnull.net/2014/01/setting-up-a-lamp-stack-on-debian-my-way/

Gonzalo Ayuso:
Bundles in Silex using Stack
July 17, 2013 @ 11:10:34

Gonzalo Ayuso has a recent post to his site showing you how to use Stack to create bundles for your Silex-based applications. Stack is a structure that allows for the reuse of HttpKernelInterface middleware to create a custom "stack" of functionality.

Nowadays almost every modern framework/applications implements HttpKernelInterface (Symfony, Laravel, Drupal, Silex, Yolo and even the framework that I'm working in ;) ) and we can build complex applications mixing different components and decorate our applications with an elegant syntax. The first thing than come to my mind after studying Stack is to join different Silex applications in a similar way than Symfony (the full stack framework) uses bundles.

In his example, he shows an example of a simple GET endpoint for a blog and API. In the first version, he calls the "run" method to execute the handling of the request. The second example, however, includes the attachment of a simple "MyKernel" middleware to the stack and calls "handle" to apply and send the modified Response back to the user.

0 comments voice your opinion now!
silex stack tutorial introduction middleware httpkernelinterface

Link: http://gonzalo123.com/2013/07/15/bundles-in-silex-using-stack

PHPMaster.com:
Data Structures for PHP Devs Stacks and Queues
June 18, 2013 @ 11:42:37

On PHPMaster.com today there's a new tutorial - the first part in a series - looking at data structures. In this first post Ignatius Teo looks at the concepts of "stacks" and "queues".

Most of us are familiar with "stacks" and "queues" in normal everyday usage. But, what do supermarket queues and vending machines have to do with data structures? Let's find out. In this article, I will introduce you to two basic abstract data types - the Stack and the Queue - which have their conceptual origins in everyday usage.

He introduces some of the common concepts behind these two ideas and includes some sample code showing how to implement them. He also mentions some of the SPL functionality that's bult into PHP to handle some of this. The SplStack and SplQueue objects take some of the hassle out of it for you.

0 comments voice your opinion now!
data structure stack queue tutorial splqueue splstack

Link: http://phpmaster.com/php-data-structures-1

Igor Wiedler:
Introducing Stack
June 04, 2013 @ 12:46:42

Igor Wiedler has started up a new project that helps you combine "stacks" of middleware related to the HttpKernelInterface from Symfony as a sort of decorator to its base functionality - Stack.

In the post titled HttpKernel middlewares I brought up the idea of bringing rack middlewares to Symfony2. In order to solidify this effort I would like to announce a new project: Stack. Stack is a convention for composing HttpKernelInterface middlewares. The name and logo are based on the idea of building a stack of middleware layers, each of which handles a particular piece of logic. [...] The main goal of stack is to give the idea of "HttpKernel middlewares" a name, so that we can more easily talk about it.

There's a stackphp organization on Github that has the start of this set of middleware pieces including tools to help you build other features. The project is focused around the Symfony HttpKernelInterface because it was the simpler, more standardized option for now. He notes that there's no reason that, in the future, when things are more standardized it couldn't broaden out to PHP as a whole.

0 comments voice your opinion now!
symfony httpkernelinterface stack middleware project

Link: https://igor.io/2013/05/23/introducing-stack.html

Nodeable Blog:
Marten Mickos The LAMP Stack is Dead, and Cloud has Killed It
April 20, 2012 @ 08:17:56

In this recent post to the Nodeable Blog, they suggest that the days of the typical LAMP stack (Linux, Apache, MySQL, PHP) are numbered because of what many of the cloud services have to offer.

For the past 10 years, the LAMP stack has laid waste to proprietary software stacks. Yes, Microsoft has held onto gargantuan profits, but LAMP has become the foundation for leading web services, whether Google or Facebook or [Insert Big Web Brand Here]. LAMP is the future. Or was. That is, until cloud killed it, as Eucalyptus CEO (and former MySQL CEO) Marten Mickos posits in a great keynote from the Percona Live: MySQL Conference & Expo 2012.

In the keynote he pointed out that it's becoming less about the whole setup and more about combining technologies to get the results you need - less "stack" and more "linked technology" (and not always the same tech for every node). He pointed to the Amazon AWS service as a prime example of a platform that allows endless flexibility as to what software can be installed and how it can be used, all with a few clicks of a mouse.

0 comments voice your opinion now!
cloud opinion lamp stack death obsolete martenmickos keynote


Brian Swan's Blog:
Azure Real World Migrating a Drupal Site from LAMP to Windows Azure
March 20, 2012 @ 08:44:04

In this new post to his blog Brian Swan shares the process that he and other Microsoft-ers went through to migrate a site off of a LAMP stack and over to one based on Windows Azure. They moved was the SAG awards website because of issues it had seen with outages and slow performance.

In many ways, the SAG Awards website was a perfect candidate for Windows Azure. The website has moderate traffic throughout most of the year, but has a sustained traffic spike shortly before, during, and after the awards show in January. [...] The main challenge that SAG Awards and Microsoft engineers faced in moving the SAG Awards website to Windows Azure was in architecting for a very high, sustained traffic spike while accommodating the need of SAG Awards administrators to frequently update media files during the awards show. Both intelligent use of Windows Azure Blob Storage and a custom module for invalidating cached pages when content was updated were key to delivering a positive user experience.

He walks you through each of the five steps (high-level, obviously) that they took in the migration:

  • Export data
  • Install Drupal on Windows
  • Import data into SQL Azure
  • Copy media files to Azure Blob Storage
  • Package and Deploy Durpal

Each step comes with some explanation and descriptions of the commands and tools used during the process.

0 comments voice your opinion now!
windows azure migrate lamp stack sag awards tutorial


Dzone.com:
A Free Amazon EC2 Cloud Server Based LAMP
February 22, 2012 @ 10:42:17

In this new article on DZone.com, Artur Mkrtchyan shows you how to get an Amazon EC2 instance up and running and get a LAMP server set up and ready to go.

In this article I'm going to show you how to create a free Amazon EC2 cloud based LAMP Server and Point your domain to Amazon EC2 Instance. There are 4 simple steps to do.

The setup process is pretty easy - getting an Amazon free account, creating a server from an existing image, installing the LAMP stack and pointing your domain at the EC2 instance. He gives a step-by-step guide of the process, including the commands you'll need to execute to get all of the LAMP packages installed.

0 comments voice your opinion now!
lamp stack amazon ec2 instance tutorial cloud server


Matthew Weier O'Phinney's Blog:
Taming SplPriorityQueue
January 18, 2011 @ 12:43:54

Matthew Weier O'Phinney has a new post to his blog today looking at one of the tools the Standard PHP Library (SPL) has to offer developers - the SplPriorityQueue (PHP 5.3+)

SplPriorityQueue is a fantastic new feature of PHP 5.3. However, in trying to utilize it in a few projects recently, I've run into some behavior that's (a) non-intuitive, and (b) in some cases at least, undesired. In this post, I'll present my solutions.

He talks about the "first in, first out" nature of queues and how it differs from a stack (including links to some of the other SPL offerings for both). He then moves into the problems he was seeing - that iteration removes values from the heap and the unexpected order of equal values in the queue. To solve the first problem, he creates an "outer iterator" that creates an "innerQueue" that's protected. The solution for the second issue - the random queue order - is a simple one: priority indexes aren't required to be integers. Strings can be substituted to help make things a bit more unique.

0 comments voice your opinion now!
splpriorityqueue heap stack queue spl tutorial iterate priority index


Andrew Curioso's Blog:
Error handeling stack in PHP 5.3+
November 19, 2010 @ 11:03:37

Andrew Curioso has a post to his blog looking at error handling in PHP 5.3, specifically in creating a "stack" that can provide more than one error handler at a time.

As you may know, set_error_handler can be used to set a custom error handler in PHP. It will catch any errors that happen in the script (with a few notable exceptions). If the function returns false then error handling resumes as normal; otherwise it is assumed that the custom handler took care of things. The problem is that you can only have one error handler active at one time. The purpose of this code is to provide a error handeling stack for PHP.

His example uses closures, so pre-5.3 installs won't be able to use it, but it's an interesting proof of concept to show how you could set four different error handlers on one execution. A code snippet is included to show how it all works.

0 comments voice your opinion now!
error handling stack closure multiple tutorial


Simon Jones' Blog:
Understanding the stack index for Zend Framework Controller plugins
July 21, 2010 @ 14:58:49

New on his blog today, Simon Jones has posted a handy guide for those using the Zend Framework out there to the stack index for plugins the framework uses.

Zend Framework Controller plugins are a powerful way to inject logic into your controller system at various points, such as before and after an action dispatch. Plugins are run in the order they are added, though it is possible to change the order by defining a custom stack index. ZF internal plugins such as Zend_Controller_Plugin_ErrorHandler, which displays a nice Error 404 page, has a stack index of 999 to ensure it runs at the end of any plugin cycle. However, it's not so obvious from the ZF manual how to set a custom stack index.

He shows how to use the second parameter of registering a plugin to define the stack level and how to get the listing of the current stack to see just where yours might need to be placed. He also includes code samples and an output example of the default Zend Framework stack.

0 comments voice your opinion now!
zendframework controller plugin stack order



Community Events











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


application example code component hack overview package hhvm release composer install podcast framework symfony2 language unittest introduction security facebook opinion

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