Archive for August, 2007

Turning on display_errors in WAMP – Video Tutorial

Thursday, August 30th, 2007

PHP Video Tutorial

Hi,

Within a WAMP installation, I ran into a little issue today when trying to change php.ini’s ‘display_errors’ property.

By default WAMP installs with ‘display_errors’ to ‘Off’:

display_errors = Off

… This is a pain-in-the-ass setting when trying to write new PHP code because errors don’t get displayed in the browser window; you have to go to the log file.

So like any good nerd, I popped open php.ini and made the change:

display_errors = On

Problem is that it didn’t work. I soon discovered that WAMP was using ANOTHER php.ini file on my machine!

Solution:

Run phpinfo() and look for the property: ‘Loaded Configuration File’

This will tell you what php.ini WAMP is using.

-

I created a video (with more details on WAMP and php.ini) for those who like to watch.

Thanks,

Stefan Mischook

www.killerphp.com

Object Oriented PHP Tutorial Updated

Sunday, August 26th, 2007

php logo

Hi,

I’ve update my beginners tutorial on object oriented PHP adding steps 12-17. I cover two new basic OO concepts in these steps:

  • Constructors.
  • Access modifiers.

Again, this is a code intensive article where I expect you to follow along with your PHP editors.

More to come.

Thanks,

Stefan Mischook

www.killerphp.com

Object Oriented PHP Tutorial Released

Wednesday, August 22nd, 2007

php logo

Hi,

I’ve just released a written tutorial on object oriented PHP, that targets people totally new to OO PHP.

Beginners Object Oriented PHP

Based on an article I wrote for a web design magazine; the tutorial is presented as a series of simple steps where I walk the reader through the process of building objects while at the same time, exposing them to basic object oriented concepts.

The first 11 steps (of 23) are up now.

-

This tutorial is actually the outline to a set of videos I will be producing in the near future … Just as soon as I am finished with my dental work.

… It hurts I tells you!

Thanks for reading,

Stefan Mischook

www.killersites.com
www.killerphp.com

Why PHP is the choice language – a business owners perspective.

Friday, August 10th, 2007

php logo

Preamble

I have written this article to speak to business owners and other non-nerd types. So you will not see me go into nerd-details regarding my arguments.

Instead, I concentrate on the business arguments and only touch on the technological issues underlying them … when it makes sense to mention the nerd stuff.

Introduction

I’ve already written about why I think PHP is the language that web designers should learn and why Ruby is no threat to PHP.

One thing I feel that needs to be addressed (in non nerd terms,) is why it makes business sense to use PHP for your web based applications.

A Non-Biased Opinion

Before I get into the meat of my arguments, I want to point out that I am not some PHP nerd looking to sell PHP.

Yes I am the Killerphp.com guy, but I decided to put up this web site because I concluded that PHP was the choice language today.

… This from a guy who has written software in 6-7 languages (could be 8-9, I’ve lost track) over the years.

Up until a few years ago I was mainly a Java nerd – though I used several other languages too.

The point is that after years of experience as both a programmer and business owner managing programmers and projects, I found that for small and medium sized projects (I can’t comment on big enterprise jobs,) PHP has been the most effective language for me.

The Business Questions

When you are choosing a framework/language for your new project, you have to ask yourself a few key questions:

  • Is the language reliable?
  • Does the language have a strong community?
  • Is it easy to find programmers who use that language?
  • Is the language productive?

All these questions relate to cost. In a nutshell, if any of these things fall short in the language/framework you choose, it’s going to cost you more money – sometimes a lot more!

What do I say ‘framework/language’ and not just ‘language’?

I want to keep uber-nerds from criticizing me for calling PHP’s competition (like ASP.net) a language, when strictly speaking, ASP.net and other competitors are not programming languages. Rather they are frameworks that enable the creation of database-driven web sites.

Translation into non-nerd English:

PHP itself is a language but ASP.net, classic ASP, JSP are not … but they do the same things as PHP. These competing technologies are frameworks (for creating database-driven websites,
) built on top of programming languages.

For instance, JSP (the framework) uses Java as its’ programming language to do its’ thing and classic ASP typically uses VB Script.

Contrast this to PHP, that was created (from inception) to build dynamic database-driven websites.

… but I digress from the main point of this article.

My business experience and how it has shown me that PHP is king.

As I mentioned before, besides being a programmer and all around nerd, I’ve actually been (and still am) the ‘business owner’ hiring and managing a small team of programmers.

So why PHP? Remember those 4 points I made above? Well PHP shines (outshines) all the competition when you look at them as a whole.

Perhaps in one area or another, one of the other technologies can match or may even beat PHP, but non of them are so well rounded.

One story of my own

I will only recount one quick story that makes my (business) point. About 2-3 years ago I decided to build a new web application using my favorite language at the time: Java.

After months of stuttered development (and $10 000 – $12 000 not including my time,) I had a stuttering mess that kinda worked. This happens all too often in software development BTW.

Anyway, I decided that this had to be fixed, so I had it reproduced with PHP while (at the same time,) adding new features. My cost for the total rewrite came out to $700. I should have went with PHP from the start …

Stefan Mischook

www.killerphp.com
www.killersites.com

PHP Classes and Objects video tutorial

Friday, August 3rd, 2007

php logo

Hi,

I’ve released a new video that basically covers the content covered in the PDF: Classes and Objects.

-

… It is the last bit object oriented PHP theory before we jump in and start writing actual PHP code.

Video: PHP classes and objects

Thanks,

Stefan Mischook

Classes and Objects in PHP

Wednesday, August 1st, 2007

php logo

Hi,

I’ve written up a short (2 pages,) document that goes over some of the very basics of object oriented programming - it should take you all of 5 minutes to read.

I wrote this as the preamble to my next video on object oriented PHP where we will actually create living breathing PHP objects.

Here’s a small snippet from the PDF:

How objects are created:

Step 1:

You create a class that ‘describes’ an object. Much in the same way a blueprint ‘describes’ a building. Instead of room dimensions etc … PHP classes / blueprints details a bunch of things about an object:

a. Variables it contains.
b. Functions it contains – yep, classes typically have functions in them.

Objects are much more powerful and complex when compared to functions. As such, there are many other special things that can be found in classes, which are unique to classes. Again, more on that later.

Step 2:

Once you’ve defined your class, you are ready to tell the PHP engine to actually create a class from your blueprint. There are special commands (PHP code,) that tell the PHP engine to create an object from the ‘blueprint’ you described/outlined in a class.

Step 3:

When the PHP script is run (with the code that instructs PHP to create an object … based on the class,) PHP actually creates a living, breathing object based on your class.

What I mean by ‘creates a living, breathing object, is to mean that the object is actually created in (server) memory.

Thanks for reading and watching.

Stefan Mischook

www.killerphp.com
www.killersites.com

Top of page  go to top of page