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

Auth0 Blog:
Creating your first Symfony app and adding authentication
Aug 03, 2016 @ 12:36:21

In this new post to the Auth0 blog Prosper Otemuyiwa shows you how to create a first Symfony framework based application and add in authentication with the included Guard functionality.

Symfony is a PHP framework, made up of a lot of decoupled and reusable components. It's a framework that promotes standardization and professionalism, supports best practices and interoperability of applications. In this tutorial, I'll show you how easy it is to build a web application with Symfony and add authentication to it without banging your head on a wall! Check out the repo to get the code.

They start with a brief overview of some of the components the framework is made up of (the most commonly used ones) and its concept of "bundles". He then helps you create your first Symfony application, explains its basic structure and starts in setting up controllers. Then comes the authentication and user validation pieces: registration handling, user functionality and creating its related database storage. Next up is setting up the routes for the application applying the authentication handling and finishing out the views for output. They end the post with a look at the profile debug bar, how Symfony compares to other frameworks and how to optionally integrate the Auth0 functionality in if you choose.

tagged: auth0 symfony introduction basics tutorial authentication integration

Link: https://auth0.com/blog/creating-your-first-symfony-app-and-adding-authentication/

Loggly.com:
The Ultimate Guide - PHP Logging Basics
Dec 08, 2015 @ 11:34:32

Loggly, the online logging management service, has posted a guide that aims to help you get up to speed with logging in PHP starting from the basics out to more recent changes in PHP 7.

This guide explores the basics of logging in PHP, where to find PHP logs, and how these logs help you more effectively troubleshoot problems and monitor your PHP application. There are a couple of different elements you’ll want to consider logging: errors emitted by the PHP engine itself when a core function fails or if code can’t be parsed, custom errors that your application triggers, usually caused by missing or incorrect user input and activities in your application that you may want to analyze at a later time, such as recording when a user account is updated or content in a CMS is updated

They start with a look at the configuration settings you can change to modify how and what your application logs. They also mention run-time configuration changes and the default error log locations (file-based). From there they get into some of the basic, built-in logging functions and the format of the logs they write. The next section talks about application error logs (logs based on failures in PHP itself) and an example of writing logs with JSON instead of plain text. The post ends with a look at exception handling and logging for base, custom and SPL exception types, pointing out the change in PHP 7 around the Throwable interface.

tagged: logging basics application custom tutorial function introduction configuration

Link: https://www.loggly.com/ultimate-guide/php-logging-basics/

Brandon Savage:
The framework you learn doesn’t really matter
May 20, 2014 @ 09:21:50

In this new post to his site Brandon Savage suggests that you don't learn any particular framework - learn PHP first, then move up from there.

Towards the end of my talk at phpDay in Verona, I was asked by two developers which framework I thought they should learn: Symfony or Laravel. I understand the pressure that developers feel like they’re under to learn a framework, and to somewhat “predict the future” by figuring out what is likely to be popular in PHP for the next few years. But my answer to them wasn’t what they expected. I told them that if they were new to PHP, that they should focus on learning PHP.

He notes that while frameworks can make it easier to get up and running more quickly, they can also make "tribes" if there's not a solid foundation in the language first. If the developer knows the language first, they can move into any framework and with limited effort pick it up and run with it. PHP frameworks come and go, and learning just one can limit you future when its popularity fades.

tagged: framework learn language opinion basics

Link: http://www.brandonsavage.net/the-framework-you-learn-doesnt-really-matter

SitePoint PHP Blog:
Using Solarium with SOLR for Search – Implementation
May 07, 2014 @ 10:54:10

The SitePoint PHP blog has posted the third part of their series looking at using the Solarium tool to hook your PHP application into a SOLR search instance. In this latest part of the series they get down to the actual search implementation.

In the first part I introduced the key concepts and we installed and set up SOLR. In part two we installed and configured Solarium, a library which enables us to use PHP to “talk” to SOLR as if it were a native component. Now we’re finally ready to start building the search mechanism, which is the subject of this installment.

He starts with a simple search example, making a request to select the matches for a given query (given on the URL as a variable "q"). He shows how to run the select and fetch the results as a result set. He enhances this, containing the search logic inside a class and making a template to show the results. He also includes examples of how to use the "Disjunction Max", sorting and pagination functionality. Finally, he looks at a more complex type of search, a faceted search, and includes code examples of making the request and displaying the results.

tagged: solr solarium search engine tutorial implement basics faceted

Link: http://www.sitepoint.com/using-solarium-solr-search-implementation/

NetTuts.com:
Routing Overview & Basics in Symfony 2
Apr 17, 2014 @ 12:10:12

If you're relatively new to using the Symfony2 framework, you might be wondering about some of the things happening during requests to your application. One of these things is the routing and handling of each request. In this new post from NetTuts.com they introduce you to the foundations of Symfony2 routing in a screencast.

In the last video, I said we'd take a look at controllers next, but I actually feel it may be easier to learn the framework in a slightly different order. Instead, we're going to learn about the basics of Symfony 2 routing, to give our applications clean and pretty URLs and make it easy to manage our applications URLs and links. We're not going to get too detailed, as Symfony's routing can do quite a bit, but we'll at least cover what we need to know by keeping it straight and to the point.

The screencast is a bit less than 10 minutes long and provides an overview of the routing, how it interacts with bundles and controllers. There's also a bit about using annotations to help define routing information directly in the controller.

tagged: routing basics symfony2 introduction screencast demo

Link: http://code.tutsplus.com/tutorials/routing-overview-basics-in-symfony-2--cms-20754

DZone.com:
PHP Performance Crash Course, Part 1: The Basics
Jun 12, 2013 @ 14:56:13

In a recent post to DZone.com Dustin Whittle talks about performance in PHP applications and gives you a crash course on some of the basics around it (this is part one of a series).

We all know performance is important, but performance tuning is too often an afterthought. As a result, taking on a performance tuning project for a slow application can be pretty intimidating – where do you even begin? In this series I’ll tell you about the strategies and technologies that (in my experience) have been the most successful in improving PHP performance. To start off, however, we’ll talk about some of the easy wins in PHP performance tuning. These are the things you can do that’ll get you the most performance bang for your buck, and you should be sure you’ve checked off all of them before you take on any of the more complex stuff.

He talks some about why performance matters and some of the more common practices to introduce immediate performance improvements into your application. His list includes things like: update PHP, use an opcode cache, use autoloading and session optimization. He also talks about using processing queues for blocking work and learning how to use code profiling tools to find the pain points.

tagged: performance crash cource series part1 basics

Link: http://java.dzone.com/articles/php-performance-crash-course

NetTuts.com:
HTTP: The Protocol Every Web Developer Must Know – Part 1
Apr 09, 2013 @ 10:56:28

On NetTuts.com there's a new tutorial about what they think is the one thing every web developer should understand - the HTTP protocol and how its used in web-based communications.

HTTP stands for Hypertext Transfer Protocol. It’s a stateless, application-layer protocol for communicating between distributed systems, and is the foundation of the modern web. As a web developer, we all must have a strong understanding of this protocol. Let’s review this powerful protocol through the lens of a web developer. We’ll tackle the topic in two parts. In this first entry, we’ll cover the basics and outline the various request and response headers.

They cover some of the basics of the protocol first including its statelessness, the concept of URLs and the HTTP "verbs" (like GET, POST and DELETE). They also briefly cover the HTTP response codes (ex. 200, 304) and the flow of the request and response to and from the web server. They also look at some of the basic HTTP headers and the actual low-level text formats of the requests/responses.

There's a section at the end of the post that links you to a few tools that you can use to view the HTTP messaging happening in your requests, some of which you might already have. They also briefly cover the use of HTTP in a few libraries - ExpressJS, Ruby on Rails and jQuery's Ajax handling.

tagged: http protocol series basics headers statuscode verb request response

Link: http://net.tutsplus.com/tutorials/tools-and-tips/http-the-protocol-every-web-developer-must-know-part-1/

Anthony Ferrara's Blog:
In Response To: Building Secured Web Applications Using PHP - The Basics
Jun 28, 2011 @ 11:15:10

In a response to this post that introduced some basic security methods for your applications, Anthony Ferrara has posted some corrections and updates to the suggested methods, even pointing out where some of them are completely wrong.

Today an article popped into my feed reader that raise my eyebrows. The article's title is "Building Secured Web Applications Using PHP - The Basics". The summary of the item looked interesting, so I decided to open it up...What I found blew me away. It was filled with loads of bad information including some down-right wrong suggestions. Let me go through point by point and shed some light on the subject...

His response goes back through the original article by section header and explains either why the advice was bad and/or the more correct way to do things.

Security is not something you can learn in a page. It's not something that you can learn in a single book. It takes a lot of time and effort. It should not be trivialized into a simple "Do this and you'll be secure" style post. It sends the wrong message...
tagged: building secure application basics response correction

Link:

Techie Talks Blog:
Building Secured Web Applications Using PHP - The Basics
Jun 24, 2011 @ 11:06:11

On the Techie Talks blog today there's a post from Idrish Laxmidhar with a few simple reminders of things you can do to help with the basic security of your PHP applications, mostly surrounding filtering and escaping.

The list includes some of the basics like:

  • Avoiding $_REQUEST when possible because of the ambiguity of where the information could come from
  • Keep register_globals off (thankfully a default!)
  • Checking values for specific data types before using them
  • Filtering user input
  • Disabling the error output (turning down the reporting levels) on a production environment

For some more good recommendations on good security practices in PHP applications, check out this list or some of the recommendations from the PHP manual itself.

tagged: security web application basics

Link:

Zend:
Webinar - PHP Security Basics (Nov 28th @ 9am PST)
Nov 28, 2007 @ 08:30:23

Zend is hosting a webinar today covering some of the basics of PHP security for your site:

Security is not just important when you are doing financial transactions - an insecure Web site can be used by others for malicious purposes to launch attacks against other Web sites. There are a few must-knows for anyone who ventures out into the world of PHP Web development. In this webinar John Coggeshall will focus on the absolute necessities when doing secure Web development.

There's still time to register and get in on the hour long session (hosted by John Coggeshall). The time for the event is 9:00 am PST (GMT -07:00, San Francisco).

tagged: zend webinar security basics zend webinar security basics

Link: