Introduction to PHP Classes

Since PHP version 5 has been released, it has been improved with Object-Oriented Programming, using classes. It’s one of the most used features in system programming languages like C++ and can now be used in PHP.

In this article I assume you know the following in advance:

– You know what variables are and how to assign values to them in PHP.
– You know what a function is and how it works.

Before I start, I want to tell a bit about functions.

Continue reading

Tutorial: Setting up SSH keys

Using SSH is a great way to remotely manage a server and to securely transfer data to and from it. You basically connect using SSH with your username and password. In that case you authenticate with something you know, which in this case is the password.

But you can also authenticate with something you have, like an SSH key. You can use this to authenticate without a password, and even configure the server to only allow SSH keys to prevent password attacks.

This tutorial shows how to configure the SSH server, generate SSH keys for each user and optionally disable password logins.

Continue reading

Setting up an Apache web server: Permissions

Many people who are configuring a web server for the first time are struggling with the proper file and group permissions. Either the scripts don’t execute properly, or they can’t upload or modify files without getting a Permission Denied error message. The only way to make it work is by setting the CHMOD permissions to 777 (world read, write and execute), which is very dangerous. Any individual could upload a (PHP) script to the server, and cause serious damage (erase the files or even disrupt the OS if the security is very weak). I’m going to teach you how to set up the permissions properly to make the server both functional and safe.
Continue reading

PHP Passing information — HTTP POST vs. HTTP GET vs. Sessions vs. Cookies

During the creation of PHP scripts you might encounter a situation where a value needs to be passed from one page to another. This will mostly be required when sending the visitor through a wizard or a login screen. This can be achieved by using:

  • Sessions
  • Cookies

I will briefly explain each of those.
Continue reading

Performing a clean installation with Mac OS X 10.7 “Lion”

Apple has released more information about their upcoming OS Mac OS X 10.7 “Lion” last monday. It is going to be released in July, exclusively through the Mac App Store. This means you can purchase it, and can install it immediately (depending on how fast you can download the 4 GB sized OS). The first question that slipped into my mind was: “How can you perform a clean install?”. Luckily there’s already a solution which developers found out (who could already download a developer preview through the App Store).

Continue reading