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

PHP Roundtable:
039: From Idea To Production: Part 2
Mar 01, 2016 @ 09:50:43

The PHP Roundtable podcast has posted their latest episode, the second part of a series devoted to working "from idea to production" - Episode #39.

We get an update on status of the project we discussed in part 1 and discuss next steps to take our dance event management app idea to production.

Like in part one of the series, host Sammy Kaye Powers is joined by guests Steven Maguire, Jocelyn Lopez and Glen Hinkle. You can watch the recording of this live show either using the in-page video player or directly on YouTube. If you enjoy the show and want to see future episodes, be sure to subscribe to their feed and follow them on Twitter for updates as they're released.

tagged: phproundtable podcast video part2 series idea production update

Link: https://www.phproundtable.com/episode/part-2-turning-an-idea-into-code-for-production

Zend Developer Zone:
Z-Ray Tip #4: Getting Rid of It!
Jan 29, 2016 @ 10:44:14

On the Zend Developer Zone they've posted the fourth part in their series of tips around using the Z-Ray profiling tool in your PHP applications. In this fourth tip they show you how to "get rid of it" in certain parts of your application.

Well, while Z-Ray is a great friend to have when developing your apps, there are just some parties you don’t want it to show up at. You might be using PHP scripts for accessing static pages. Or, you might not want Z-Ray to be displayed for one specific request. In production, you most definitely don’t want Z-Ray popping up for users using your app!

There are numerous ways to disable Z-Ray both in development and in production to make sure your development workflow is not interrupted and your live apps are not affected. Here are a few of them.

They include a few different ways to disable the tool including the use of a function call in the code (zray_disable), using a header in the HTTP request and, naturally, from the Z-Ray toolbar itself. They also talk about setting it up to be removed for production in one of two modes, either selective (only showing for certain requests) and completely disabled.

tagged: zray tip disable development production api get header selective

Link: http://devzone.zend.com/7149/z-ray-tip-4-getting-rid-of-it/

Dalibor Karlović:
Testing your Symfony application on production
Oct 05, 2015 @ 09:14:50

In a new tutorial Dalibor Karlović shows you how to test your Symfony application in production to get a more "real world" picture of how your application is performing for the rest of the world.

The problem here is that you almost cannot guarantee that you can replicate the production environment down to a single detail, it might have a slightly different underlying system, a slightly different network setup, even a different updates applied might mean it works for you, but not on production.

He starts the post by talking about the testing support already built into Symfony and the different parts tested by unit versus functional tests. He gets into some actual (functional) test examples, showing how to evaluate the response from an API request and where the major part of the overhead is - the database interaction. He takes the next step and looks at how to avoid "impure" functional testing and only then starts talking about switching between database types (SQLite vs MySQL) for better performance measurements. Finally, he gets to the topic of the article, running tests in production, and includes a "gotcha" to look out for (hint: don't hard-code IDs).

tagged: test symfony application production functional unit sqlite mysql

Link: https://medium.com/@dkarlovi/testing-your-symfony-application-on-production-a143483768c9

PHP Roundtable:
021: From Idea To Production: Part 1
May 29, 2015 @ 12:17:24

The PHP Roundtable podcast, hosted by Sammy Powers, has a new show posted (#21) staring off a series about moving from just an idea to a production application. His guests for this episode are Steven Maguire, Jocelyn Lopez and Glen Hinkle.

We discuss an idea for a web app and identify ways to turn it into a real-life product on the web.

We start with describing the domain and the problems the app should solve. Then we identify the personas that will interact with the app. We discuss the features features the app should have to fix the problems and we sort all the features by priority. Finally we talk about timeline, deliverables and next steps. The app we discuss will be launched to production by the next airing of this multi-part series of taking an idea to code.

You can watch this latest episode either through the in-page video player or directly over on YouTube

tagged: phproundtable podcast video idea production application part1 ep21

Link: https://www.phproundtable.com/episode/part-1-turning-an-idea-into-code-for-production

Derick Rethans:
Xdebug 2.3: Shared Secret to Enable Tracing or Profiling
Apr 07, 2015 @ 11:19:44

Derick Rethans has posted another in his series covering the latest release of the Xdebug debugging tool for PHP, version 2.3. In this new article Derick introduces the "shared secret" handling, a custom string that for the "XDEBUG_PROFILE" that can trigger the the profiler to start.

Xdebug's profiling and trace file capabilities can both be triggered by a cookie, GET or POST variable, as long as you have enabled xdebug.profiler_enable_trigger and/or xdebug.trace_enable_trigger. With these triggers enabled, basically anybody could initiate a profile run, or trace file, by simply sending the XDEBUG_PROFILE or XDEBUG_TRACE cookies with an HTTP request. Although you should not really run Xdebug in production, you can see that this is not an optimal solution. Xdebug 2.3 adds supports for shared secrets for the trace file and profiler triggers through the xdebug.trace_enable_trigger_value and xdebug.profiler_enable_trigger_value.

He points out a browser extension, The easiest Xdebug, that already has support for this new feature. He also mentions two other tools but they have yet to integrate support for these shared secrets (but will soon hopefully): Xdebug halper and xdebug-helper-for-safari .

tagged: xdebug series release secret string tracking enable production extension

Link: http://derickrethans.nl/xdebug-2.3-tracing-profiling-shared-secret.html

SitePoint PHP Blog:
8 Heroku Add-ons for Production Ready PHP Apps
Jul 14, 2014 @ 12:56:50

The SitePoint PHP blog has a new post from editor Bruno Skvorc with a list of eight Heroku add-ons for PHP applications. These add-ons (they call them "dynos") he lists help with things like logging, monitoring, working with CDNs and adding deploy hooks.

Heroku uses “dynos” as units of computing power which spin up your slugs. Dynos are lightweight, isolated containers for your apps which can execute any process type and can run and scale independently. There are two types of dyno – a web dyno, which handles web requests letting you serve more users as you increase your web dyno power, and worker dynos, which handle everything else like running your code and processing background tasks.

Bruno walks you through getting a sample Laravel-based application up and running on Heroku's PHP functionality and provides a list of add-ons from the Marketplace to get you started. His list includes:

These add-ons and more all come with descriptions, configuration settings/commands to enable them and some with screenshots showing the results.

tagged: heroku addon production application list marketplace

Link: http://www.sitepoint.com/8-heroku-addons-production-ready-apps/

Community News:
[php]architect to Produce Orange elePHPants
Jan 17, 2014 @ 10:28:22

If you've been around the PHP community for any length of time, there's a pretty good chance you've seen the language's "mascot" floating around - the elePHPant. This mascot has even been made into a stuffed toy in various colors - blue, red, yellow and now thanks to [php]architect, orange.

Ready to add, or start, your collection of elePHPants? We started a KickStarter campaign to produce a run of Orange elephants. [...] There’s much more information over at our Kickstarter project. The campaign is set to a short timeframe and ends on February 3rd as we need to get our production order placed as soon as possible. So get over there and claim your orange elePHPant before time runs out!

The Kickstarter campaign, originally fully funded at $1,000 USD has now reached an amazing $16,000+ USD. There are still plenty of spots left open if you want to pledge and get in on this purchase. Options range from a simple $1 USD for support all the way out to a $250 USD option that gets you a "zoo" (ten small elePHPants and one large elePHPant).

tagged: orange elephpant toy stuffed kickstarter production

Link: http://www.kickstarter.com/projects/eliw/php-architect-orange-elephpant

Jordi Boggiano:
Composer: Installing require-dev by default
Jul 16, 2013 @ 13:34:56

In this latest post to his site Jordi Boggiano talks about the change in Composer a few months back that made it install development resources by default. This was recently argued against by Jeremy Kendall so Jordi wanted to clear the air a bit on the subject.

A couple months ago when releasing alpha7 I took care to note in the changelog that the install command would also start installing dev requirements by default in the next release. I did that change some weeks ago and now people started to notice. The rationale behind the change is fairly simple, it's about consistency and ease of use. Consistency between the various commands which now all default to have require-dev enabled. Ease of use because in 99% of the cases, when you type a composer command by hand you should be doing so on a dev machine where it makes sense to have dev requirements enabled.

He points out that, when deploying to production, it's usually an automated process and adding the "no-dev" flag to the script is pretty simple. He notes that "install" is not only meant for production package management and, while it's used less in development it's not targeted towards one particular environment.

tagged: requiredev composer install production development environment

Link: http://seld.be/notes/composer-installing-require-dev-by-default

Rob Allen:
Caching your ZF2 merged configuration
Jun 19, 2013 @ 09:43:28

Rob Allen has a a new post to his site today showing how you can cache the merged settings from all of your configuration files combined in a Zend Framework v2 application.

Zend Framework 2's ModuleManager has the ability to cache the merged configuration information for your application. This is very useful as it allows you to separate out your configuration within the config/autoload directory into logical files without worrying about the performance implications of lots of files.

There's some ZF2 configuration options that tell it to cache this data once it's loaded the first time, but he notes one issue with this - caching in development. It can be annoying when you make a change and nothing happens because it's cached. To prevent this he shows you how to only cache if the application is marked as in production (based on the "APPLICATION_ENV"). Separate main configuration files are made for each environment, one that caches and one (for dev) that doesn't.

tagged: cache merged configuration zendframework2 tutorial production development

Link: http://akrabat.com/zend-framework-2/caching-your-zf2-merged-configuration

Kevin Schroeder:
Why you should not use .htaccess (AllowOverride All) in production
Feb 25, 2013 @ 10:31:09

Kevin Schroeder has posted the results of some research he did around using the "AllowOverride" setting in Apache. He found some interesting differences when it was set to "all".

Commonly known as .htaccess, AllowOverride is a neat little feature that allows you to tweak the server’s behavior without modifying the configuration file or restarting the server. [...] Beyond the obvious security problems of allowing configuration modifications in a public document root there is also a performance impact. What happens with AllowOverride is that Apache will do an open() call on each parent directory from the requested file onward.

He includes the output from a strace call in the post - first showing the function calls with it set to "none" then the same request with the setting on "all". More "open" calls are being made in the second run, increasing the execution time by a decent amount.

tagged: apache allowoverride all htaccess production setting performance