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

TutsPlus.com:
Building Your Startup With PHP: Choosing and Configuring Production Hosting
Oct 03, 2016 @ 10:47:19

The TutsPlus.com site continues their "Build Your Startup with PHP" series of tutorials with the latest part of the series. In this most recent article they move into the hosting world and offer some tips and setup options for your production hosting.

In this tutorial, I'll explore choosing an ideal hosting platform for Meeting Planner and the initial configuration of our server. I'll be guiding you through the process as I migrate the pre-launch website to a better production environment for our upcoming alpha launch.

[...] As a reminder, all of the code for Meeting Planner is written in the Yii2 Framework for PHP. If you'd like to learn more about Yii2, check out our parallel series Programming With Yii2.

They start by looking at how to choose the right hosting company for your application and abilities. For their particular needs, they opted for managed hosting (like Rackspace or Digital Ocean). For the remainder of the tutorial, they show the setup with Digital Ocean and a simple "droplet" (virtual machine instance). They walk you through the setup of the droplet, the server configuration for hosting the application and packages to install. Then they check out and set up the code for the "Meeting Planner" application and, finally, update the DNS to point to the new server.

tagged: startup hosting application production digitalocean

Link: https://code.tutsplus.com/tutorials/building-your-startup-with-php-choosing-and-configuring-production-hosting--cms-23359

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