Can AI Write PHP Code?

Image : Can AI Write PHP Code?

I asked ChatGPT 3.5 “Can AI write PHP code?”. ChatGPT 3.5 is a free version of Artificial Intelligence.

I’ve been a freelance PHP developer since 2006. I consider myself to be a senior developer.

https://youtu.be/k7CNqcKxKTg

Here is what ChatGPT responded:

Yes, AI can be trained to generate PHP code. PHP is a widely used scripting language for web development, so some models and tools can assist in generating PHP code snippets or even more complex scripts.

However, it’s important to note a few things:

1.**Quality and Intent**: The quality of AI-generated code can vary. AI can produce syntactically correct code based on training data, but it might not always produce efficient or well-structured code that adheres to best practices or security guidelines without careful oversight.

2.**Use Cases**: AI-generated PHP code can be useful for generating boilerplate code, automating repetitive tasks, or even suggesting solutions based on specifications. It can help developers save time and focus on higher-level aspects of development.

3.**Limitations**: AI models are trained on existing data and patterns. They might struggle with highly specialized or novel requirements that deviate significantly from the data they were trained on.

4.**Human Oversight**: Regardless of AI assistance, human oversight, and validation are crucial. Developers should review and test all generated code to ensure it meets project requirements and standards.

In summary, AI can write PHP code and assist developers in various ways. Still, it is most effective as a tool to augment human creativity and expertise rather than replace it entirely.

I’ve been experimenting with ChatGPT 3.5 for maybe 6 weeks as of the writing of this article. I am interested in article writing and PHP code creation.

Before we get started, let’s discuss what is known as prompts. Prompts are the way to interact with ChatGPT 3.5. The better the prompt the better the reply from ChatGPT 3.5.

It is a learning experience.

The other thing that needs to be discussed immediately is the more PHP programming experience the developer has, increases the potential for using and implementing PHP code produced by ChatGPT 3.5.

Recently my local Linux group discussed using AI to generate code. The consensus was that in the short term, there would be little change. The short term is maybe the next 3 years.

The group felt that at some point the junior and mid-range PHP developers would be displaced.

The group also found this scenario interesting in that as the senior developers retire or exit programming there would be no one to replace them, as the juniors and mid-range developers would be non-existent. It might take 6 to 10 years to create a senior developer.

Let me give you a few examples.

If I ask AI to “create a login script in PHP using the MySQL database”. ChatGPT responded:

Creating a login script in PHP using MySQL involves several steps, including connecting to the database, querying user credentials, and validating the login. Below is a basic example of how you can implement this:

1.**Create a MySQL Database:**

First, you need a MySQL database with a table to store user information. Here’s an example SQL to create a `users` table:

CREATE TABLE users (
    id INT(11) AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) NOT NULL,
    password VARCHAR(255) NOT NULL, — Hashed password
    email VARCHAR(100) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Note: Always hash passwords before storing them in the database for security reasons.

Use PHP’s `password_hash()` function for this purpose.

2.**PHP Login Script:**

Create a PHP script (`login.php`) that handles the login process. Here’s an example:

<?php
session_start();
// Database connection parameters
$host = 'localhost';
$db = 'your_database';
$user = 'your_username';
$pass = 'your_password';
// Create connection
$conn = new mysqli($host, $user, $pass, $db);
// Check connection
if ($conn->connect_error)
{
    die("Connection failed: " . $conn->connect_error);
}
// Check if form was submitted
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
    // Prepare the SQL statement
    $stmt = $conn->prepare("SELECT password FROM users 
        WHERE username = ?");
    $stmt->bind_param("s", $username);
    $stmt->execute();
    $stmt->store_result();
    // Check if user exists
    if ($stmt->num_rows > 0) 
    {
        $stmt->bind_result($hashedPassword);
        $stmt->fetch();
        // Verify the password
        if (password_verify($password, $hashedPassword)) 
        {
            // Set session variables
            $_SESSION['username'] = $username;
            header("Location: welcome.php"); // Redirect to welcome page
            exit();
        } else {
            $error = "Invalid username or password.";
        }
    } else {
        $error = "Invalid username or password.";
    }
    $stmt->close();
}
$conn->close();
?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,
            initial-scale=1.0">
        <title>Login</title>
    </head>
    <body>
        <h2>Login</h2>
        <?php if (isset($error)): ?>
            <div style="color: red;">
           <?php echo $error; ?></div>
        <?php endif; ?>
        <form action="login.php" method="post">
            <label for="username">Username:</label>
            <input type="text" name="username" id="username" required>
            <br>
            <label for="password">Password:</label>
            <input type="password" name="password" id="password" required>
            <br>
            <button type="submit">Login</button>
        </form>
    </body>
</html>

Instructions:

Database Setup: Ensure you have a MySQL database with a users table containing username (VARCHAR) and password (VARCHAR) fields. Use password_hash() when storing passwords.

Testing: Access login.php in your web browser, enter your credentials and check the behavior on both successful and failed logins.

Redirect Page: Create a welcome.php file to greet the user after login.

Security Notes:

Ensure your site uses HTTPS to protect user credentials.

Implement measures against SQL injection (this script uses prepared statements, which helps).

Consider adding Cross-Site Request Forgery (CSRF) protection for your forms.

Secure session management practices should be followed.

Feel free to customize the layout and logic to fit your application’s needs!

I ask “Should a cookie be implemented?” AI responds:

Implementing cookies can enhance user experience, especially for remembering user sessions or preferences. However, it’s important to handle them securely. Here are some points to consider regarding cookies in the context of a login system:

When to Use Cookies

Remember Me Functionality: Allow users to stay logged in even after closing their browser. This is usually done by storing a cookie with a token.

User Preferences: Save user-specific settings, like theme or language.

Security Considerations

Secure and HttpOnly Flags: Set the Secure flag for cookies to ensure they are only sent over HTTPS. The HttpOnly flag prevents client-side scripts from accessing the cookie, reducing the risk of XSS attacks.

SameSite Attribute: Use the SameSite attribute to help protect against CSRF attacks by controlling how cookies are sent with requests.

Token-Based Authentication: If you implement a “Remember Me” feature, use a securely generated token stored in the cookie, linked to the user’s session on the server.

Example of Implementing Cookies

Here’s a modified version of the login script that includes a “Remember Me” feature:

Updated login.php

<?php
session_start();
// Database connection parameters
$host = 'localhost';
$db = 'your_database';
$user = 'your_username';
$pass = 'your_password';
// Create connection
$conn = new mysqli($host, $user, $pass, $db);
// Check connection
if ($conn->connect_error)
{
    die("Connection failed: " . $conn->connect_error);
}
// Check if form was submitted
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
    $rememberMe = isset($_POST['remember_me']);
    // Prepare the SQL statement
    $stmt = $conn->prepare("SELECT password FROM users 
        WHERE username = ?");
    $stmt->bind_param("s", $username);
    $stmt->execute();
    $stmt->store_result();
    // Check if user exists
    if ($stmt->num_rows > 0) 
    {
        $stmt->bind_result($hashedPassword);
        $stmt->fetch();
        // Verify the password
        if (password_verify($password, $hashedPassword)) 
        {
            // Set session variables
            $_SESSION['username'] = $username;
            // Handle "Remember Me" functionality
            if ($rememberMe) 
            {
                // Generate a token
                $token = bin2hex(random_bytes(16));
                // Store the token in the database with the username
                $stmt = $conn->prepare("UPDATE users SET 
                    remember_token = ? WHERE username = ?");
                $stmt->bind_param("ss", $token, $username);
                $stmt->execute();
                setcookie("remember_me", $token, time() + 
                    (86400 * 30), "/", "", true, true); // 30 days
            }
            header("Location: welcome.php"); // Redirect to welcome page
            exit();
        } else {
            $error = "Invalid username or password.";
        }
    } else {
        $error = "Invalid username or password.";
    }
    $stmt->close();
}
$conn->close();
?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, 
            initial-scale=1.0">
        <title>Login</title>
    </head>
    <body>
        <h2>Login</h2>
        <?php if (isset($error)): ?>
            <div style="color: red;"><?php echo $error; ?></div>
        <?php endif; ?>
        <form action="login.php" method="post">
            <label for="username">Username:</label>
            <input type="text" name="username" id="username" required>
            <br>
            <label for="password">Password:</label>
            <input type="password" name="password" 
                id="password" required>
            <br>
            <label for="remember_me">
            <input type="checkbox" name="remember_me" 
                id="remember_me"> Remember Me
            </label>
            <br>
            <button type="submit">Login</button>
        </form>
    </body>
</html>

Additional Steps

Database Changes: Ensure your users table has a remember_token column to store the token.

Token Validation: On subsequent visits, check if the cookie is set. If it is, validate the token against the database and log the user in automatically.

Logout Logic: Clear the cookie and remove the token from the database when a user logs out.

Conclusion

Using cookies responsibly can enhance user experience, but always prioritize security by following best practices.

ChatGPT can make mistakes. Check important info.

Summary

I asked ChatGPT to create a PHP login script as an example and to answer the question “Can AI write PHP code?”. It does a great job. This experiment reinforces my statement that to effectively use AI to generate code, requires a senior developer.

Upon request, AI-generated login cookie code with lots of comments and explanations.

All in all, I think using AI, as a senior developer, might reduce development time by 30% – 50% – a big savings.

I did not mention that AI can have what is referred to as hallucinations. It would be worth your time to understand AI hallucinations.

What is a Full-Stack PHP Developer

Some say a full-stack PHP developer is someone who can program both on the client-side and the server-side. The server side is programming in PHP and the client-side is programming in the browser using JavaScript.

Others define a full-stack developer as someone who can troubleshoot both the software layer and the server layer.

I like both definitions. I think a full-stack PHP developer is someone who has, at least, enter-level PHP web server system administrative skills and the ability to deal with the full programming stack.

Lets Break That Down

There are two parts to this – The software layer and the Linux PHP hosting layer.

I believe all PHP developers should have a basic familiarity with Linux. I think a PHP programmer should use Linux on their desktop (unless there is a reason not to) and have the skills to configure a basic LAMP or LEMP testing server.

The PHP web server Consists of:

LAMP stands for:

Linux – The operating system.

Apache – The web server.

MySQL – The data engine.

PHP – The programming language.

LEMP stands for:

Linux – The operating system.

NGINX – The web server.

MySQL – The data engine.

PHP – The programming language.

Notice the difference is Apache vs NGINX web servers.

The software layer consists of:

Hypertext Markup Language (HTML) – HTML is the bones or structure of the website.

Cascading Style Sheets (CSS) – CSS gives a website its look and feel

JavaScript, JavaScript library or framework, and AJAX – JavaScript and the associated frameworks and AJAX are used to create interactive web pages.

The PHP programming language – PHP is a server-side programming language which means it runs on the server and sends output to the browser.

Structured Query Language (SQL) – SQL is used by the developer to talk to the MySQL data engine.

There is a lot to know. Knowing and being able to work with all that has been outlined above, in my opinion, makes one a full-stack developer.

You Might Find This Article Worthwhile : Skills a PHP Programmer Should Have

Conclusion

What a Full-Stack PHP developer is can depend on who is defining what a Full-Stack PHP Developer is. There are two definitions 1) a PHP programmer that can program both on the server-side and on the client-side, and 2) a PHP developer than can troubleshoot both the client-side software, the server-side software, AND the PHP web hosting server itself.

I believe a PHP developer must have basic Linux hosting skills. This does not mean this developer needs to be a production server administrator. What I am saying is this PHP developer should be able to configure a LAMP or LEMP stack for testing.

Should You Learn PHP – Use the Hedgehog Concept to Determine if PHP is Right for You.

Using the Hedgehog concept to determine if you should become a PHP developer

In this article, I will cover the Hedgehog Concept and how it will help you determine if you should become a PHP programmer.

My name is Keith Smith. I have been a freelance PHP programmer since 2006 and I have evaluated my career choices several times using the Hedgehog Concept.

I first become aware of the Hedgehog Concept through the book “Good to Great” by Jim Collins. The book was copyrighted in 2001 and I read it in 2005 at the suggestion of my employer. Interestingly my employer at the time was not following the teachings of this book.

The book “Good to Great” is about how businesses move from good to great and the book shares many findings. One of which is the Hedgehog Concept.

Hedgehog Concept

In a nutshell, the Hedgehog Concept leads us to that one big thing we should focus on. In business, it is the service, product, or concept that is right for that particular business. For instance, Walgreens is on almost every corner. How they got there is the reason they moved from good to great – they focused on what they could be the best at.

The Hedgehog concept can be used personally to evaluate our best career path at any given point.

Using this same set of principles will guide us to the one thing we should focus on.

The Fox and the Hedgehog

The Hedgehog Concept is based on an old Greek parable “The fox knows many things, but the hedgehog knows one big thing.”. Jim Collins took that parable and turned it into 3 questions that take us from being a fox that knows a lot of things to a Hedgehog who does great things because he is focused on his one big thing.

In this article, I am going to focus on how we can determine our personal Hedgehog Concept.

Our Personal Hedgehog Concept

I am only going to cover the Hedgehog Concept and how it is applied to us. We will look at it as our personal Hedgehog Concept, or what is the single or dominant thing we were encoded to do.

We are encoded with many abilities, however, one will more than likely be our personal Hedgehog Concept.

The Three Questions of the Hedgehog Concept

There are three principles or questions that make up our personal Hedgehog Concept.

  1. What are you deeply passionate about?
  2. What are you genetically encoded to do?
  3. What drives your economic engine?

What Are You Deeply Passionate About?

Passion is an indicator of what you should be doing. If you are passionate about a particular area absent one of the other two indicators, this particular passion is not your one big thing. The area that you are passionate about and fulfills the other two indicators probably is your one big thing – or the thing you should concentrate on.

What Are You Genetically Encoded to Do?

Each of us is unique. Each of us was created with special skills and abilities – things we are naturally good at. By the time you become a teenager, you should start seeing your strengths and the things you are a natural at. Some are good at art, some are good at writing, some are good at business, etc.

What Drives Your Economic Engine?

This is a big one. You are looking for something you are passionate about that can drive your economic engine.

Putting All Three Together

Having passion about something you are a natural at, that also drives your economic engine is your one big thing – your Hedgehog Concept

I would recommend taking some time to go through this exercise before you decided on what you would like to do for a career. 

A Real-Life Story

Let me share a story and why I think going through this process is important.

About 10 years ago a young man approached me at a men’s gathering and said he wanted to become a PHP programmer. I asked why. He told me that I was successful so he thought he would do what I do. That answer gave me a lot of insight. I was looking for passion. He was looking for a job or a skill that could create success.

At that point I suggested he determine his personal Hedgehog Concept and then if he determined becoming a PHP programmer was what he should pursue, then come back and we would talk. He never returned.

My Advice to Any Aspiring Programmer

Do not choose a career path just because those skills are in demand and because the pay is good.

Every one of us is encoded with certain abilities. And every one of us has a set of passions. We need to take the time to look deep inside to determine our correct path.

I’ve heard it said, “Do what you are passionate about and the money will follow.”. If you choose the wrong path you might end up less than satisfied or in the end, being miserable.

Let me give you an example. Registered Nurses (RN) get paid well and are in high demand. I have the ability to become an RN, however, I would be miserable because I am not passionate about being an RN. It’s just not me.

Summary

This article is about using the Hedgehog Concept to determine if you should become a PHP Programmer. By using the Hedgehog Concept we can determine our career path and lead a more fulfilling and richer life.

If you have not already visited my YouTube channel, please do : PHP Coder USA YouTube Channel.

How To Check Laptop Battery Using Upower

Checking your laptop battery from the command line is rather easy using the upower command. This article is an introduction to the Linux upower command and an example from my Linux laptop which is used as a PHP Programming test server.

Background

I have 2 laptops that I use as test servers. They were cheap so I bought one for my wife and one for me. We never really used them so I converted them into PHP programming test servers.

Originally I took the batteries out and stored them away from the computers because we were not using them as portal devices.

Theses computers are probably 4 years old. One battery is dead. Surprisingly the other battery appears to be in like new condition. It has been about 8 months since I changed the good battery and today it is showing 35% charged. It has been setting in my desk drawer.

The local Linux community tells me to keep my battery charged between 30 and 70 percent. They say anything below 30% will add extra wear to the battery as will any charge over 70%.

Currently I do not need the battery, however I may want to load something Like Mint Linux on this computer and use it as a mobile Linux computer. Therefore I would like to keep the battery in good condition and that is why I periodically charge the battery.

Monitoring Laptop Battery Charge

My laptop is running Ubuntu 16.04lts and I had to add the upower package. From the command line it is rather easy – two steps.

sudo apt-get update
sudo apt-get install upower

This morning I put the good battery into my laptop and ran “upower -i” /org/freedesktop/Upower/devices/battery_BAT0 from the command line. Here is the output:

Notice my battery is at 37% change. Amazing!! I was expecting the battery to be dead.

To determine just the state of the battery, time to fully charge, and the percentage of charge, run the following command on the command line.

upower -i $(upower -e | grep BAT) | grep –color=never -E “state|to\ full|to\ empty|percentage”

Here is the output from my laptop:

Since I am only charging my battery to 70%, I expect a much shorter charge time than what a full charge would take. It show it would take 1.7 hours for to fully charge.

Upower Man Page

You can learn more by running “man upower” on the Linux command line. The man page does not give much information, however for my needs, I do not need anything more than is documented in this article.

Conclusion

You may need to install the upower package which is very simple. I provide the command necessary to install the package from the command line on Debian and it’s derivative Linux distributions, such as Ubuntu 16.04lts.

If you need a simple way to monitor your laptop battery from the command line upower may be all you need.

What is CodeIgniter and How Does it Work

This article explains what the CodeIgniter framework is and gives insight as to how CodeIgniter works. 

CodeIgniter is Object Oriented, Model-View-Controller, a Rapid Application Development framework for PHP, that has a small footprint, is blazing fast, has a short learning curve, and is easy to install. CodeIgniter does this by providing commonly needed functionality, helpers, and libraries.

What is CodeIgniter

CodeIgniter was created by Rick Ellis the owner of Ellis Labs. The first release was on February 28, 2006. CodeIgniter was wildly successful and very popular within the PHP community. 

CodeIgniter has a lot going for itself.

Small Footprint

Version 3.1.11 is only 16 megabytes in size. That is small. In the early days, CodeIgniter was less than 4 megabytes.

Version 2.2.6 is about 4K compressed and is 5.1 megabytes uncompressed.

Blazing Fast

Most report CodeIgniter is lightning fast. It is compatible with shared hosting which it’s pears cannot say. The CodeIgniter framework puts little stress on the hosting server.

Excellent Documentation

The manual covers, in detail, every aspect of how to use CodeIgniter to build websites and web applications. All features and functionality are well documented.

The documentation can be viewed online at: Codeigniter 3 User Guide.

It is worth noting that in the upper right corner of the page there are three lines next to the search box. Clicking the three lines changes the layout to the old-style layout which is much more helpful. 

CodeIgniter Manual Layout Toggle

Once clicked, a tab will appear in the upper right area named “Table of Contents”. If clicked, it will display a full menu that will give you access to every bit of the documentation.

CodeIgniter Manual Menu Drop down Image

Easy to Use

Ease of use is one of CodeIgniter’s hallmarks. It was created early before PHP added several features that are complicated. CodeIgniter 3 is simpler than CodeIgniter 4. CodeIgniter 4 embraces the PHP features that make it more complicated. For the one-man-band, those features are not necessary.

Easy to Install

To install CodeIgniter all that is required is to download the zip file and upload it to your server and unzip it. And point your web browser to the instilled Codeigniter and it should show you the welcome page.

Object-Oriented

Even though CodeIgniter is Object-Oriented, an inexperienced programmer will probably not notice since everything is well structured and well documented.

Model-View-Controller

As you probably already know CodeIgniter is Model-View-Controller. This design pattern is widely used and respected. It helps structure one’s code and makes it easier for multiple developers to work on the same project. 

What is a Controller – This is the boss of the other two. It is the brain. This is where most of the programming logic is placed. 

What is a View – Is the display layer. This is where the HTML, Cascading Style Sheets (CSS), JavaScript, AJAX, and content come together to create what shows in your browser. 

What is a Model – This is where all the database functionality lives. These functions are called by the controller so the data can be processed and then sent to the view.

License

The current owner, British Columbia Institute of Technology, uses the MIT License. Here is what it says:

Copyright (c) 2014 – 2019, British Columbia Institute of Technology

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The Online License

Versions

Currently, there is two versions of CodeIgniter. Version 3 and 4.

Some of the differences are:

  • CodeIgniter 4 is not backward compatible.
  • Version 4 has added support for Namespaces.
  • Autoloading support has been added to version 4

Life Cycle

According to the Codeigniter forums, Codeigniter 3 will be supported for about 2 more years. 

The repository will live on. The only real issue with using Codeigniter 3 after community support ends is PHP version upgrades and security issues will go unaddressed.

Loosely Coupled

CodeIgniter is referred to as loosely coupled because only a controller is required. The model and view are not required to make a working website. Though, this is not the default configuration. 

CodeIgniter Release History

VERSIONRELEASE DATEEND of LIFE
1February 28, 2006Unknown End of Life
2January 2011October 2015
3October 2015Currently Supported
4February 24, 2020Currently Supported

Helpers

There is about 21 helpers. Each is a set of functions that can be plugged into your code as you build your application. Helpers help the developer accomplish tasks. To get a feel for what a helper is let us look at a couple of helpers that are routinely used.

URL Helper Example

The URL helper is a set of functions that make working with URLs easier. You can read the on-line URL Helper documentation for more information.

For example, to convert the title of an article into a URL string, the helper function url_title($title) could be used. Here is some sample code:

$title = "Why I Like Ice Cream";
$url_title = url_title($title) 

$url_title will contain the string “why-i-like-ice-cream”. Which can be used to create a complete URL like example.com/why-i-like-ice-cream.

The whole idea is the helpers help the developer to write less code and spend less time doing so. This is the rapid application development feature mentioned elsewhere. 

Email Helper Example

The email helper makes it easier for the developer to add email functionality to his or her application.

For example, to validate an email the developer can use the valid_email() helper function.

Here is an example:

$is_email_valid = false;
if (valid_email('someemailaddress@example.com'))
{
        $is_email_valid = true;
}

You can read more about the email helper by reading the on-line Email Helper documentation.

[] 

Libraries

There are about 30 libraries in CodeIgniter 3. Libraries help the developer complete larger tasks such as sending an email. Sending email takes a lot more effort than checking the validity of an email address such as what we previously performed.

The email library is a class that provides comprehensive functionality for sending emails. A glance at the on-line Email Class (library) might be surprising given all the options and setting that are needed to send an email. 

What is CodeIgniter Used for?

Codeigniter is a PHP framework that was created as a PHP rapid application development tool. In the early days, Codeigniter was used to create all sorts of websites. CodeIgniter is still capable of creating any type of website you can think of, however, today it is mostly used to create web applications. 

The Installation Process

If you are familiar with the Linux utility wget you can download the zipped file directly to your server and unzip it.

It is that simple.

It is not necessary to have access to the server command line. 

Installation only takes a few minutes and is just a few steps.

With wget

  1. Use wget to download the CodeIgniter zip file into the hosting root directory.
  2. Unzip the source file.
  3. You may need to rename or remove the leading CodeIgniter directory.
  4. Point your browser to your CodeIgniter install and you should see the welcome page.

Without wget

  1. Download the CodeIgniter source file onto your local computer.
  2. Unzip the source file locally.
  3. Upload the files to your server using FTP. Make sure not to include the CodeIgniter leading or root directory when uploading.
  4. Point your browser to your CodeIgniter install and you should see the welcome page.

Verify it is Working

To verify your installation is working, all you need to do is point your browser to the server where you installed CodeIgniter. 

If it is installed correctly you should see the welcome page.

Image of the Codeigniter Default Welcome Page

This is a page that comes with CodeIgniter. It gives you the path to the view and the controller. Notice the last line contains a link to the User Guide. This is a local copy. You may want to bookmark this link so you will always have access to the documentation off-line.

How Does Codeigniter work

As you have read in this article, CodeIgniter is easy to install, is blazing fast, easy to learn, is well documented, and has a short learning curve. Add to that it is Model-View-Controller.

Codeigniter is a rapid application development tool for building PHP web applications. These applications can take the form of a content management system (CMS) to an interactive web application.

Because CodeIgniter comes with so many of the needed components for building web applications, in so many ways, it is plug and play. This keeps the developer from having to recreate the wheel every time they want to build a web application.

Let start by looking at the file system. Once installed you should see a file system that looks like this:

  • /application
  • /composer.json
  • /contributing.md
  • /index.php
  • /license.txt
  • /readme.rst
  • /system
  • /user_guide

To learn CodeIgniter it would be worthwhile looking through all the directories and open the files and read through them. Do not worry if some of it or even a large portion is hard to understand. It will be a worthwhile excise that will help you as you become a CodeIgniter developer. 

In this article, we will limit our discussion to 4 directories and how they work. Knowing what we will be covering will place you well on your way to becoming a CodeIgniter developer.

As a starting point, let’s look at the welcome controller, welcome view, and the routes configuration that ships with CodeIgniter 3.

  • The welcome controller is located in: application/controllers/Welcome.php
  • You can find the view at: application/views/welcome_message.php
  • And the routes files is located at application/config/routes.php

The default URL mapping is example.com/controller/function/argument. In the case of the URL for the welcome message, it is example.com/index.php/welcome/index. 

Controller

If we look in the controller we see several lines:

1) defined(‘BASEPATH’) OR exit(‘No direct script access allowed’); – this line verifies CodeIgniter is running. If not it sends a message to the browser and stops processing. This is a security measure so the only entry point is through the index.php file located in the root directory. This will keep the bad hackers from accessing your code in ways it was not intended.

2) class Welcome extends CI_Controller – Notice the controller class name is Welcome and it extends CI_Controller. This means it inherits everything in the CI_Controller class.

3) public function index()

{
   $this->load->view('welcome_message');
}

The index function is the default function in the controller. Remember the URL mapping is /controller/function/argument. If no function is listed, the default is the function named index.

In the case of the welcome URL it is /index.php/welcome/. You can drop welcome from the URL leaving it as example.com/index.php.

Two things are taking place. One is the default controller that is defined in the routes.php file is being processed and the default function in the controller is used to complete the process so the welcome page can be displayed.

The line $this->load->view(‘welcome_message’); Tells CodeIgniter to load the view file named welcome_message’) and display it.

View

The view can be located at: application/views/welcome_message.php. A quick look inside shows it contains HTML, Cascading Style Sheets, and a minor amount of PHP code. 

Data can be transferred to the view file and the view file can use PHP to display this data. It is possible to process data in a view, however, all the processing should take place in the controller and model.

Basically, a view is web content or what is known as the visual layer.

Model

In this case, there is no database in use so there is no model. We will cover the model later in the article.

Router

The routes file is located at: /application/config/routes.php. There is only one line in the file that we need to evaluate here. That line is: $route[‘default_controller’] = ‘welcome’;

What this line tells CodeIgniters is the default controller is the welcome controller that is listed above. That is why you can go to the website URL such as example.com/index.php and see the welcome message. 

Removing index.php from the URL

To remove the index.php from the URL (example.com/index.php) refer to the manual page at: CodeIgniter URLs and then scroll down to “Removing the index.php file”.

If you are using shared hosting it is probably already configured to remove the index.php from the URL. If it is not configured you will get a blank screen or an error message.

If an error occurs or you get a blank screen contact your hosting provider for help. 

Create a Model for the Welcome Application

Create a model class named “people_model” in the application/models/ directory. Name the file People_model.php. It is a good idea to create a model for each table. This will keep the models organized and by naming the model the same name as the table it makes it easy to understand what goes with what model and it also becomes self-documenting. 

The model code looks like this.

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class People_model extends CI_Model {

	public function get_people()
	{
 		$query = $this→db→get('people');
		return $query->result();
 	}
}

For more information you can refer to the online Model documentation.

We will be using MySql as the data engine. You should have MySql or one of it’s derivatives in your hosting account. 

We need to create a database, a table, and populate it with data.

To do so we need to:

  1. Create a database user. 
  2. Create a database.
  3. Create a table.
  4. Populate the database.
  5. Configure CodeIgniter so it will know about the database and be able to use it. 
  6. Create the model (listed above).

I’m going to make a simple database with a table that contains three names.

  1. Tom Cruise
  2. Tom Selleck
  3. Matt Damon

The SQL for Creating the Database

CREATE DATABASE contacts

The SQL That Creates the Table

CREATE TABLE `people` (
  `id` int(11) NOT NULL,
  `FirstName` varchar(100) NOT NULL,
  `LastName` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

The SQL That Inserts (adds) the Data to the Table

INSERT INTO `people` (`id`, `FirstName`, `LastName`) VALUES
(1, 'Tom', 'Cruise'),
(2, 'Tom', 'Selleck'),
(3, 'Matt', 'Damon');

Configure the Codeigniter Database 

Edit application/config/database.php

Scroll down until you see the following 4 lines

'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',

Set these values according to your database configuration.

For more information you can refer to the CodeIgniter configuration documentation.

Modify the Welcome Controller

In the welcome controller I added a constructor like this :

public function __construct()
{
 	parent::__construct();
 
 	$this->load->database();
 
}

The constructor was necessary so the database could be initialized.

Then I added two lines to the index function:

$this→load→model('People_model');
$data['people'] = $this->People_model->get_people();

and modified the load->view line by adding $data.

$this->load->view('welcome_message', $data);

This transfers the needed data to the view.

Modify the Welcome View

/application/views/welcome_message.php

Immediately after the <div id=”body”> tag, add:

<ul>
<?php
foreach ($people as $arr) {
	echo '<li>';
	echo $arr->id.' ';
	echo $arr->FirstName.' ';
	echo $arr->LastName.' ';
	echo '</li>';
}
?>
</ul> 

The Output

Image of the CodeIgniter Modified Default Welcome Page

As you can see the three names are listed on the home page.

Everything in CodeIgniter 3 is that easy. 

Related Questions

Is CodeIgniter easy to learn?

CodeIgniter is very easy to learn. If you already know how to program in PHP at the beginner level and understand the basics of Object-Oriented Programming in PHP, then you will find CodeIgniter easy to learn. CodeIgniter has the shortest learning curve of all the PHP Frameworks.

How long does it take to learn CodeIgniter?

To learn CodeIgniter might take 10 to 15 days if you spend 2 hours a day studying CodeIgniter. Hands-on is very important. If you follow the brief tutorial listed above, you will be well on your way. Learning Codeigniter comes down to understanding how to create models, views, controllers, and how to implement and use the helpers and libraries. 

Is CodeIgniter Still Relevant? 

CodeIgniter has lost a lot of its popularity since Rick Ellis decided to give CodeIgniter to a new home.

On July 9th, 2013, Rick Ellis, the founder of EllisLab, announced he was looking for a new home for CodeIgniter. At that time CodeIgniter was arguably the most popular PHP framework. Click here to read Ellis’ online statement – EllisLab is seeking a new owner for codeigniter

That announcement set the stage for 2 things to happen. First, it threw the Codeigniter community into chaos because the future was unknown. Because of that a lot of developers fled to other PHP frameworks. After the dust cleared it appears most of the developers moved to Laravel. The second thing put in motion was CodeIgniter would become like the other PHP frameworks. Its footprint would increase, it would become more complicated and harder to learn. Ellis said it: “

PHP as a language is maturing, and CodeIgniter deserves to take advantage of its new stabilized features.”.

This announcement was a death sentence for CodeIgniter. CodeIgniter 4 contains Namespace and utilizes PHP Composer. These two are not necessarily needed and add to the learning curve.

CodeIgniter is slowly losing what sets it apart – being blazing fast, having a small footprint, and being extremely easy to install and learn. 

British Columbia Institute of Technology eventually took control of CodeIgniter

CodeIgniter continues to thrive though. 

If you are looking at CodeIgniter as a future skillset I’d caution you to look beyond. Having said that, there are still COBOL programmers out in the wild. I suspect there will be a need for CodeIgniter developers for a while. 

There is a lot to be learned from using CodeIgniter. Installing and learning how to use it is a great learning experience. I learned a lot from using CodeIgniter and looking at its source code to understand how things work.. 

I learned about Model-View-Controller, and how to modularize my code. When it was all said and done I was able to analyze CodeIgniter to gain the knowledge necessary to develop my small framework. 

Installing and using CodeIgniter will never be waste, it is a great learning opportunity, especially if you go into it with that mindset. 

Is CodeIgniter Dead?

Some think the current owners of CodeIgniter, the British Columbia Institute of Technology, is taking CodeIgniter down the wrong path. 

The downward spiral started the day Rick Ellis announced he was looking for a new home for CodeIgniter. At that very point, the future of CodeIgniter was thrown into chaos. A lot of CodeIgniter users migrated to other PHP frameworks. Most moved to Laravel.

CodeIgniter’s niche used to be that is had a small footprint, was blazing fast, was easy to install, and had a small learning curve. With version 4 in its early days, CodeIgniter is starting down the path towards trying to compete with the other PHP frameworks. Trying to compete with the other PHP frameworks is a mistake. 

CodeIgniter needs to go back to its roots of having a small footprint, being blazing fast, being easy to install, and having a small learning curve.

Google trends show CodeIgniter gets about 60 searches a day.

Image of Google Tends for CodeIgniter

Then when we look at the comparison of CodeIgniter vs Laravel, it looks like CodeIgniter is getting less than 10 searches a day and Laravel is around 75 searches a month.

Image of Google Trends for CodeIgniter vs Laravel

This indicates the interest in CodeIgniter is rather low.

Conclusion

  • This article is a brief look at CodeIgniter. 
  • There is two version – 3 and 4.
  • CodeIgniter is MVC.
  • It has helpers and libraries.
  • It is easy to learn and has a short learning curve of maybe 20 – 30 hours before the developer is ready to start building real-world applications.
  • CodeIgniter has a small footprint, is blazing fast, and easy to learn (version 3).
  • Version 4 is starting down the path away from the roots of CodeIgniter and moving out of its niche.

What is phpMyAdmin and How Does it Work?

This article introduces phpMyAdmin and gives a brief overview of how it works.

phpMyAdmin is free, open source, and was created using the PHP programming language. It was created as a wrapper around the MySql database. PhpMyAdmin is a web interface that gives the user the ability to manage their databases from any device that runs a modern web browser.

What is phpMyAdmin

phpMyAdmin is a free software tool that is used to administer the MySql data engine. It was created in PHP. It was first released in September 1998. Being very mature, it is well documented and widely used. 

Some of the things you can do with phpMySql are create and test SQL queries, manage databases, and manage users.

phpMyAdmin is very feature-rich. It is used as a web interface for the MySql data engine and its derivatives.

I use it often when I need to create a complicated SQL query. SQL stands for Structured Query Language, which is how programmers interface with databases. 

In the next section, we will dig a little deeper.

How Does it Work

Login – To get started one must log in with a MySql username and password. This will give the user access to any databases they have permission to use.

Image of the phpMyAdmin Login Form

The phpMyAdmin Home Page – Once logged in you will see the phpMyAdmin Home Page that will look like the following.

In the upper left area is where you can find the main menu. 

Main Menu Functionality

  • To return to the home page click the “phpMyAdmin” text.
  • The “home” icon returns to the home page as well.
  • The next icon which looks like a door with a green arrow, is the logout button.
  • The round icon that contains a question mark links to the local phpMyAdmin documentation.
  • The icon that looks like a page with a smaller page over it is linked to the MySql reference manual.
  • The gear is liked to the settings pages.
  • The green icon causes the page to refresh when clicked.

Top Menu Functionality

The top menu will be referred to as tabs in this article.

  • Databases – Linked to the databases page.
  • SQL – Linked to one of the two query building pages. This is the less feature-rich version of the two SQL pages.
  • Status – Linked to a stats page. 
  • User account – Links to the user account overview page.
  • Export – Linked to the export database page.
  • Import – Linked to the import page.
  • Settings – Linked to a page that provides for import and export configuration.
  • Replication – Linked to the replication configuration page.
  • Variables – Linked to the server variables and settings page.
  • Charsets – Linked to the character settings and collation page.
  • Engines – Links to the storage engine page.
  • Plugins – Links to the plugins page.

Home Page List of Databases and Tables

On the left side of the home page, you will see a list of databases. By clicking on a database, it will expand to display the tables within that database.

Manage Users

  1. Create a User:
    1. Click the “home” icon, click the “User accounts” tab, then click “Add user account” which is about in the middle of the form.
    2. Complete the form.
  2. Modify a user account:
    1. Click the “home” icon, click the “User Accounts” tab, then click the “Edit privileges” link that is on the same line as the user account you want to modify.
    2. On this page you can:
      • Edit the user’s privileges.
      • Add privileges to other databases.
      • Grant or revoke global privileges.
      • Change the user’s password.
      • Change the login information (username, hostname, password).
  3. Remove a user:
    1. Click the “home” icon.
    2. Click the “User Accounts” tab.
    3. Click the checkbox next to the user you want to remove.
    4. Then select “Drop the databases that have the same names as the users” if you want to remove the database with the same name as the user.
    5. Click the “Go” button.

About User Privileges 

User privileges are what access the user is given. Such as what databases they can see and modify and from where, such as being restricted to the local server.

Manage Databases

  1. Create a database.
    1. Click the “home” icon, click the “Databases” tab.
    2. Enter the Database Name, select the collation, and click the “Create Button” button.
    3. A form will be displayed that allows you to enter the table’s name and the number of fields the table will contain. Complete the form and click on the “Go” button.
    4. Complete the form and click the “Save” button.
  2. Modify Databases.
    1. From the left column of the home page select the database you would like to modify by clicking on the database name. 
    2. The center panel will show all the tables in the database. From this form, you can branch-off to perform other actions to include creating a new table.
  3. Delete or drop a database.
    1. From the left column select the database you would like to drop by clicking on the database name. 
    2. Then click the “Operations” tab.
    3. Under “Remove database” click “Drop the database (DROP)” 

Manage Tables

Image of the phpMyAdmin Database List
  1. Click the home icon, then click the “Databases” tab. You will see a form like the one above.
  2. Click the Database you wish to manage. This will take you to the “Structures” tab. You will be on a form like the one below. This is where you manage your tables.
phpMyAdmin Structures Tab

You can now:

  • Browse – This allows you to “Edit”, “Copy” or, “Delete” each record. You will see the columns along with their data. You can also export data from this screen.
  • Structure – From this screen, you can modify the structure of each field – Change, “Drop”, or you can perform other operations.
  • Search – This allows you to search your data.
  • Insert – This is a form that allows you to add a record to the selected table.
  • Empty – This feature will remove all the records in the table. Be careful with this option.
  • Drop – Allows for the entire table to be removed/destroyed. Be careful with this option.

Note you can also use the list of tables in the left panel to drill down from your database to a table, and the table’s fields.

About Collation

Collation defines how to sort or how to weigh items in relevance to other items. For more information read the MySql documentation on supported character sets and collations [https://dev.mysql.com/doc/refman/8.0/en/charset-charsets.html] Notice MySql recommends you test your selected collation to ensure you are getting the results you desire.

Import Data

  1. From the top menu click on “Import”. 
  2. A form will appear. Click “Choose File”, which will open dialog page for selecting the file you want to import. To the right of “Choose File”, you will see the max file size that you can import. The value can be adjusted. Modifying this value is outside the scope of this article.
  3. Select the “Character Set”.
  4. Set or unset Partial Imports.
  5. Set or unset Enable foreign key check.
  6. Set the file format.
  7. Set the SQL compatibility mode or leave it at its default of none.
  8. Set or unset “Do not use AUTO_INCREMENT for zero values”.
  9. Click the “Go” button.

Export Data

  1. From the top menu click on “Export”. 
  2. Select the “Export method”:
    1. Quick – display only the minimal options.
    2. Custom – display all possible options.
  3. Select the “Format” from the drop-down.
  4. Click the “Go” button. 

SQL Queries

phpMyAdmin Plain SQL interface

SQL stands for Structured Query Language. This is another area you will want to become familiar with. SQL is your bread and butter when it comes to working with databases. I use the SQL box to build complex SQL statements.

There are two ways to get to the query interface.

  1. Click the “home” icon, then click the “SQL” tab to get to the plain SQL interface:
  1. From almost any page you can click the table under a database on the left column and then click the “SQL” tab. That will bring up an SQL interface that has a lot of features you will probably find useful. From here you can click any of the buttons that are directly below the query box. The cool part of this is it will create the type of query you want to create based on the table you selected. This is a great way from a beginner to learn SQL. 
Image of the phpMyAdmin Query Builder

The buttons I want to point out are:

  • <Select *> – Will create a wild card select (a select pulls data).
  • <Select> – Will create a select listing all the fields in the table. 
  • <Insert> – Will create an insert query. This query contains all the fields of the table (an insert creates a new record and populates it).
  • <Update> – Will create an update query. This query contains all the fields of the selected table and place holders for the data that is to be updated (an update query is used to update data). 
  • <Delete> – Will create delete query ( a delete removes a record). 
  • <Clear> – Will clear the text box. 
  • <Format> – This will format the query so it can be used within a program.

phpMyAdmin Documentation

There is a lot to know. This article does not cover everything. This link will take you to the phpMyAdmin documentation where you can learn more.

Conclusion

There are a number of tools you can use to manage your MySql data, each has different features you might find useful.

The nice thing about phpMyAdmin is it is a web application, meaning it runs in a browser. That means you can access phpMyAdmin from any device that runs a modern browser.

phpMyAdmin is very feature-rich and is a great tool for programmers and system administrators. 

11 SEO Tips for the Small Business

Search Engine Optimization or SEO is easy if you know what you are doing and is difficult and frustrating if you do not.

  1. My SEO History
  2. Title Tags
  3. Meta Tags
  4. Permalinks
  5. Focus On a Keyphrase
  6. Turn on Pingbacks
  7. Use Alt Tags
  8. Interlink
  9. WWW or Non-WWW
  10. Sign-Up to Google Search Console
  11. Content is King
  12. Building Links

My SEO History

My path is not without its failures.  Here is my story.

In 2002 I was a freelance desktop application developer.  I was trying to figure out how to market my skills. A friend of mine had been talking about SEO so I thought that was the answer.  With little understanding I set out to build a website for Tucson Custom Software.  About 9 months later I got a call from a guy that was looking for some help with a Word document.

In 2004 I ran into a guy that claimed he knew SEO.  I told him my story and showed him my website ranked number 1 for “Tucson Custom Software”.  He looked at my website and then jumped on his computer and told me no one was searching  “Tucson Custom Software”.  He was very nice about it and showed me what I was missing.  He showed me I needed to research what people are searching for and use those terms to build my website.

Back then I was building websites from scratch.  Not today.  Now I use WordPress to build websites.

WordPress Makes SEO Easier

WordPress SEO is easier than those sites I used to build from scratch.  I spend a lot of time on Drupal and found it to be time consuming to get it to the same place WordPress is right out of the box. Right out of the box WordPress is ready for SEO.  Be careful that the

Title Tags

The title of your pages / articles is very important.  The page / article title tag is important to Google.  Google uses the title taqg to determine what your page / article is about.  This will effect this particular page / article ranking and may effect how your whole site is seen.  The title tag should be an h1 tag and the page / article should contain only one h1.  The h1 for the WordPress page / article is built into the theme.

One of the things you can do to boost your WordPress SEO is to use search terms in your page / article title.  Only use words that describe or are contained in your copy.

Meta Tags

Permalinks

Focus On a Keyword or Key phrase

The word or phase people use while searching on the search engines (think Google) are referred to as keywords or key phrases.  I refer to them as search terms because that is what they are.

If you do not use Keywords and Key Phrases in your copy your site will take a lot longer to rank and may rank for terms you are not interested in.  Part of WordPress SEO is to use the search terms people are using to search for your products, services, and content.  Keywords and Key Phrases tell the search engines (think Google) what your content is about and to a greater extent what your website is about.

Be sure to use your chosen Keywords and Key Phrases sparingly so you do not over optimize your website, which could lead to a penalty on Google.

Turn on Pingbacks

Use Alt Tags

WWW or Non-WWW

Sign-Up to Google Search Console

SEO is supposed to be about all the search engines.  Over the years all of the traffic to mi=y website comes from Google with rare exception.  The current Google Search Console give a lot of information.  It will tell you waht terms your website ranks for and what the ranking is.  This alone is worth it’s weight in gold.  You can use this to track your and validate your SEO campaingn.  Great information.

Content is King

Title

Meta Tags

description

legith

KeyWord Usage

Uniqueue

This is an interesting one.  I used to be obsessed with back links or links from someone else’s website to mine.  Then I realized we are all in the same boat.  We want back links and they are hard to come by.

You will hear stories about link bate.  Stories about the guy that wrote this really cool article that went viral and he got tons of links to that article.  Who is this guy?  Do you know him?  I don’t know him, and you probably do not know him either.

So really it comes down to good WordPress SEO optimization and content.  They say content is king.  It takes good content to rank and it takes good content to keep the reader reading.

Skills a PHP Programmer Should Have – a Definitive Guide

Image : Skills a PHP Programmer Should Have

There is a lot of skills a PHP developer should have. Here is my list. 

Skills a PHP Programmer Should Have. A PHP developer needs to have a wide range of skills. This includes HTML, Cascading Style Sheets, JavaScript, PHP, MySql, and Linux. Along with this he or she should possess a strong understanding of security, good communication skills and, don’t forget decent project management skills.

HTML

HTML is the backbone or the bone structure of web pages. This is the foundation of all the skills a PHP programmer should possess.

Cascading Style Sheets (CSS)

Gives a web page and to a greater extent the entire website it looks and feel. This is the design layer.

JavaScript

JavaScript is a must-have skill for every PHP programmer. JavaScript runs in the browser and gives the programmer the ability to make a website interactive.

AJAX

Asynchronous JavaScript and XML (AJAX) is how JavaScript is applied to make the website interactive. When I think of AJAX I think of the ability to talk with PHP to send and receive data from the server to create fully functional web applications.

Some JavaScript Library Such as jQuery or Angular JS

JavaScript is very quirky, mainly due to the different implementations by the different web browser engines. The different implementations can drive a developer crazy. Luckily the community provides libraries such as jQuery that encapsulate or make these differences transparent to the programmer. 

The PHP Programming Language

A PHP programmer must know most of the following. There is a lot to know.

  • Understand that the PHP Ecosystem consists of the following:
    • PHP runs on a web server that more than likely is a Linux web server. 
    • PHP is Open Source and is native to Linux.
    • PHP works with a database server, more than likely MySql.
    • PHP can do a lot, such as server automation, FTP, work with files, interact with other servers, send emails and a lot more.
  • The Basic Skills a PHP Programmer Should Have
    • How to create a basic PHP script, complete with an opening tag that tells the server the file is a PHP program or script.
    • How to open a database connection and how to interact with the database so that data can be Created, Read, Updated, and Deleted.
    • How to include other PHP programs.
    • Control structures such as if statements and loops.
    • Working knowledge of variables, strings, constants, arrays, user-defined functions, variable scope, mail, cookies, sessions, commenting, and error handling.
    • How to embed PHP in HTML.
  • NameSpace – is a way of structuring “blocks” of code so that naming conventions do not become a problem.
  • Dependency Injection – DI is a design pattern that allows for including other code within the current code set or object, making the injected code available to the calling object.
  • GIT is for revision control. This is a set of commands that aid the developer in managing his / her code and the repository. There are several online repositories such as Github and Bitbucket.
  • Composer is a PHP dependency management system that works at the project level. It can be used for installing an application and managing it as well. Think version control.
  • AutoLoading takes the place of the programmer having to manually include every needed external program file.
  • Design Patterns such as:
    • Model View Controller (MVC) is used to separate the data (model), design (view), and the business logic (controller) in a way that makes development and management easier.
    • The Singleton pattern restricts the instantiate of an object to a single instance. This means the same object can be reused.
    • The Active Record pattern is used to aid the developer in designing database interaction.
    • Entity-Attribute-Value is a data model that is used to describe your data tables. This pattern is supposed to make extending your database easier. I have found this pattern to slow the application excessively.
  • Object-Oriented Programming (OOP) in PHP is a software design that, like its name implies, is based on objects. PHP allows for OOP and is also procedural.
  • Regular Expressions are used to filter data.
  • Website security is a skill all developers should possess.
  • Every developer must have project management skills at a personal level. Being able to manage (plan and execute) a project is a must.

MySql

MySql is a data engine and is the most popular data engine (MySql and it’s clones) used with PHP. There is a lot to know about MySql. Every PHP programmer needs to have a solid grasp of how to implement and use MySql. That includes the Structured Query Language (SQL), which is how PHP interacts with MySql.

A PHP developer needs to know how to use SQL to manage data as well as how to create databases, tables, and indexes.

Understanding database normalization is a huge plus that will help the developer when creating a new project.

Linux

The amount of Linux skills required will vary. From my experience, a seasoned PHP developer will need to know the following about Linux hosting server management. 

  • Be able to add and remove users.
  • Be able to create and manage virtual host configuration.
  • Be able to locate and decipher logs.
  • Be able to identify the correct php.ini file that is used on the server.
  • Be able to configure PHP via the php.ini file.
  • Must understand Mod_Rewrite, why it is used, and how to implement it. 
  • Be able to install and manage phpMyAdmin.
  • Knowledge of, and ability to, manage the .htaccess file.

A PHP programmer is not required to be a full-blown Linux systems administrator. The developer will need at least the listed skills though. 

Troubleshooting

  • How to turn on or off error reporting in PHP.
  • Location of server logs and which log to look in for what.
  • Some full-stack troubleshooting skills (HTML / JavaScript / PHP / MySql / Linux / Networking).

Code Editors

There are a lot of code editors. Every developer has their preference. Some editors are free and some come with a licensing fee. Here is just a couple:

PHPStorm – Made by Jet Brains, PHPStorm is a lightweight smart PHP Integrated Development Environment (IDE) that costs $199.00 for the first year and $159 a year thereafter. I would recommend you get your PHP feet wet before deciding to pay for an editor. 

Visual Studio Code – The source code editor Visual Studio Code is developed by Microsoft. It runs on Windows, Linux, and Mac. It is free and relatively easy to learn. This is where I recommend you start.

Atom – While free, Atom comes with a little bit of a learning curve. I would not recommend Atom for the beginner PHP programmer. Your mileage may vary.

Development and Production Hosting Environments

Development Server – This is where you will do all your development. This can be as simple as a localhost PHP development environment.

Testing Server – After you have done your development you can use a testing server for working with the stakeholders. 

Production Server – This is the server where your final product will do its magic. A production server is a public-facing server. Only fully tested code should make it onto the production server. 

Domain Name System (DNS)

Developers are not system administrators and therefore do not need to know DNS intimately. Eventually, every developer needs to have a working knowledge of DNS. 

Ability to Set and Meet Deadlines

Setting deadlines is based on the ability to estimate how long a task or project can take. Estimating how long a task or project can take, effects a developer’s ability to set deadlines and therefor will also effect meeting that deadline. 

This is a potential problem area. It is very difficult to estimate how long a task or project can take. It may take years to get good at determining how long a task or project may take. 

Project Management

This is a skill that will take a while to develop. As mentioned above, estimating how long a task or project will take is difficult. That is not the only skill required for project management. Project management entails managing the entire project from developing a quote, communicating all concerned at the appropriate time, and pulling together resources as needed to complete the project.  

Soft Skills

Soft skills are big in today’s market place. This list should get you started:

Communications – This is my pet peeve. I say communicate soon and often. As a developer, it is easy to recluse and work a project for a while. I have found the best approach is to get the stakeholders involved as early and as often to ensure a project stays on track. 

How to Work as Part of a Team – It is tough to be a developer working in the cube farm. It requires the ability to play well with others, be helpful, and avoid office politics. It is equally important to pull your weight. 

Ability to Know What is Changing – This one is difficult. How do you keep up with changes? You can become active in professional organizations. Another couple of things you can do is listen to your peers and read the updates on the technologies you are working on.

Know What You Don’t Know – It is extremely difficult to know what you don’t know. This may require a bit of humility. There are a few sources, such as, your coworkers, journals, and professional organization to name a few places where you can become aware of the things that you unaware of. 

Empathy – This is big. I’ve worked in the cube farm where other developers were not very understanding or empathetic. Everyone grows and learns at a different rate. Each person has their strengths and weaknesses. We should show empathy towards others as we would expect them to show towards us.

Patience – Sometimes things take a while. When working in a team environment it is wise to set back and let things work their way out. That does not mean to not be involved. On the contrary, we should be involved while also being patient.

Be Open Minded – Everyone has an idea. Some are better than others. We should solicit input from others and listen to others. This can be very helpful. 

Problem Solving Skills – Every developer needs to be a problem solver. Most often some level of creativity is required when solving problems. 

Accountability – Accepting responsibility is very important and often can become a teachable moment. Also, it will earn you a lot of respect. 

Time Management – Don’t let yourself become distracted. The modern-day comes with a ton of distractions. Keep social media, games, politics, news, etc for outside of work.

Strong Work Ethic – We have all gone to work and got sidetracked or distracted and neglected our assignments. This is something we should avoid. It is always good to show up early, stay a bit late, take only the allotted breaks while staying focused on our assignments.

Additional Skills Required if You Specialize

You will need to have a working knowledge of the ecosystem you plan to specialize in as well as strong PHP programming skills. Each of the following comes with a learning curve.

WordPress – WordPress is very popular, easy to implement, and use. As a developer, you will need to know how to create function files and plugins. The WordPress ecosystem is vast and somewhat complex.

Drupal – As an enterprise application it is not just a CMS. Drupal can be used to create almost any type of web application. Drupal comes with a steep learning curve. 

Joomla – Joomla is a CMS that is not widely used, however it does have some market share. You can plan on a learning curve if you are interested in becoming a Joomla extension developer.

WooCommerce – It is being reported that the WooCommerce market share is expanding at a rate greater than other shopping carts. WooCommerce is a WordPress plugin. If you are familiar with the WordPress Plugin ecosystem, you are well on your way to becoming a WooCommerce developer. 

Magento – I spent a couple of years working with Magento. Magento has an extreme learning curve. I would not recommend Magento unless that is what you are assigned to do. Magento requires a team to make it sing. It is not suited to the one-man-band. If you have your heart set on eCommerce, I would recommend taking a look at WordPress / WooCommerce. The CEO of a Magento agency told me to learn Magento takes about 500 hours of classroom and self-directed training plus about 500 hours of hands-on covering 6 months. Magento is not for the faint of heart.

PHP Frameworks – There are a lot of Open Source PHP Frameworks that are available. My favorite is CodeIgniter. It is well documented and is easy to learn. Worth a look. If you are looking for something a little bit more hardcore look at Laravel. Laravel is the most popular PHP framework at the moment.

The Skills a Freelance PHP Developer Should Have

As a freelancer, you might, and probably will, be working in a vacuum. You will do everything. You will snag projects, do quotes, manage projects, and empty the garbage, all from the comfort of your home office. I’ve listed out a few skills you might consider.

Communication Skills – Again my pet peeve. Your communication skills will need to be of the highest quality. This is a must-have skill. As a freelancer, you will need to interface with other business professionals. They are evaluating you every step of the way. This consists of and is not limited to emails, phone calls, quotes, and articles you have written.

Financial Management – You will need to account for all the money you earn. There will be income, expenses, bank fees, and other expenses. Your bookkeeping needs to be top quality. Don’t forget you will need to report all of this on your taxes at the end of the year. The IRS is watching and will expect your accounting and reporting is in order.

Time Management – As a freelance developer, you are solely responsible for how you utilize your time. If like me, you work from home, there is no one watching. It is easy to get sidetracked or mis-prioritize your time. Time is finite so manage it well.

Self Motivated – You will need to motivate yourself. This is a must-have skill. If you lack it you might want to look for a cube farm and a boss.

Marketing – You will need a marketing plan. What are you selling and to whom? You need to know who your competition is and how you differentiate yourself in the marketplace. Do your research before you jump feet first into consulting.

Sales – Noting happens in business until a sale is made. Unless you are a natural salesperson, you might want to take a course or two to learn a bit about sales before you go out on your own.

In Closing 

As you can see there is a lot to know to become a PHP programmer. And if you want to become a freelance PHP developer there is even more to know.

I hope this information is helpful. I wish you the best on your journey.

Everything a Website Owner Should Know

Image : Everything a Website Owner Should Know

Freelance PHP Programmers, Everything You Need to Know

Image : What Do I Need to Know About Freelance PHP Programmers?

Hiring a freelance PHP programmer is a serious undertaking. Let me share with you what I know about freelance PHP Programmers.

There are a few things to consider when hiring a PHP programmer like ensuring their skills and experience match your needs. Communication skills and fee rates are also important. There is a lot to consider when hiring a freelance PHP programmer. 

I recommend reading this guide before you search for and contract with a developer.

The PHP programming language is very popular and there is a ton of people that are willing to help you. There is only one problem – and that is what you don’t know can hurt you.

Every day I read about all the retail stores that are closing. Everything is moving to the web. Along with this, the Internet is much more complicated today than it was 20 years ago. Given this, having an experienced and professional PHP / MySql developer on your team is a must.

Assessing Your Need

The first step is to assess your needs. With that, you will have a better idea of what skills you are looking for. For example, if you are looking at building an eCommerce website, you may want to look for a WordPress and WooCommerce solution provider.

Analyzing your project will also give you insight into what type of developer you may want to hire. Below I list “the freelance developers you will find in the wild”.

Finding Someone Who Matches Your Needs

This is a tough one. Where do you look? You can start by searching the Internet. That is probably how you found this article.

There is a lot of websites that broker developers. They also get in the way. No direct contact. This has its pros and cons. The upside is you may be better protected. You will more than likely make your payments to the broker which are held in escrow. The downside is it is rather bureaucratic – you will never have direct contact with your developer. You will never build rapport nor will you ever know much about the person working your project. If that is what you want, great, if not you may want to try hiring a developer directly.

Using a broker website lends itself to small or short projects.

If you have a project that will take more than just a few hours you may want to consider hiring direct.

Hiring Direct Comes With More Than a Few Benefits

  • You Can Get To Know The Person – Getting to know the person that works on your web projects is a win-win situation. Not only do you get to know them, they also get to know you. This opens up better communications and will lead to better peace of mind.
  • You Can Evaluate The Prospective Developer – You can talk with them and evaluate their prior projects. You can also look at their social media accounts and look at their website.
  • You Have a Better Chance of Building Rapport – I think this is important. As a developer, I like to get to know the people I work with and for. I assume they like getting to know me as well. In my opinion, this leads to a much better working relationship.
  • You Can Make The Developer a Member of Your Team – Yes, making your solution provider a member of your team is a good thing. This can lead to a more efficient working environment. I like being a remote member of your team because I can learn what to expect and how to meet your needs. 

The Freelance Developers You Will Find in the Wild

You will run into these types of programmers in the wild:

  • The Guy or Gal That is Between Jobs – This is the guy or gal that was just laid off, or was fired, or may have quit their job. One of the potential problems with this person is what happened to your project when they find a new job. One of the other issues is this person may not have any real business experience. Running a project is tough. Running a project and a business at the same time is even more demanding.
  • The High School Student – My hat is off to this person. Sounds ambitious and may even have a lot on the ball. The downside is this person may not have much life experience and little or no experience running a business while juggling other obligations while trying to run a programming business. I would not expect this person to keep regular business hours.
  • The College Student – Same as the high school student except this person may be more mature and might have more life experience as well as business experience. Still, this person will be juggling many obligations. I would not expect this person to have much availability during business hours. 
  • The Hobbyist – This person is in it for the fun of it. That can bring a number of advantages and disadvantages. This person may or may not be available regularly. They may or may have low rates. One of the thrills this person my get out of a hobby business is seeing how much they can charge. On the other hand, compensation might take a backseat to other benefits and their rates may be low. 
  • The Side Hustle – This person may have a part-time or full-time job and does PHP programming on the side. The advantage might be a cheap project while the disadvantage is this person probably is not available during regular business hours and maybe less available than you would like.
  • The Offshore Developers – They usually work for far less than an American programmer who wants the going rate or something close to that. You may want to think about how the time zone difference may affect your project. I was working on a project with another company that had an Indian programmer. The time zone was 12 and a half hours different. One of the other challenges is the culture and language barriers. Even though your offshore coder may speak English they might not understand what you asking them to do – this is the language and cultural barrier. Since they are offshore there is much less accountability. Liability is always an issue when going off-shore. If your programmer does not follow your directs and does something that causes you liability, you are probably on your own. 
  • The Professional PHP Programmer – This is the guy or gal that holds regular business hours and is readily available during business hours. They probably have formed a business and I expect they will have a website. This is what they do – they provide PHP programming services. This person should have decent communication skills and should be able to run a business while attending to projects. I would expect that a freelance PHP developer would be the most stable and responsible for your project with respect to the other listed category of freelance developers. 

There are pros and cons to each one. Only you know what you are willing to endure to get your project across the finish line. In other words, do you hire a pro that can make your project easier, or do you hire a high school kid that will require you to manage them?

Type of Freelancers 

A freelancer is not an employee, they are independent contractors. These projects come in one of the following forms:

  1. Taking on short-term projects on a contract basis (gig workers).
  2. Taking on recurring tasks as an independent contractor.

As we move further into the gig economy, gig workers or freelancers will become more common.

What is the IRS Definition of an Independent Contractor

It is important that you understand what the IRS defines as an independent contractor. If you violate the IRS rules you may find yourself paying the IRS additional taxes and fees. 

The main test the IRS uses is:

  • A person is an employee if they have no control over what they do and how they do it.
  • A person is a contractor if they have control over what they do and how it gets done.

It comes down to control and relationship. If the person has a contract and comes and goes as they please while being self-directed they are probably an independent contractor.

A freelance PHP developer is someone who basically does gig projects on a contract basis. A guy I know says a freelancer is someone who created a job for themselves. I would say this is accurate and from my experience, most freelancers are a one-man-band. More than one developer is an agency. Working with an agency is usually different than working with a freelancer. 

Division of Website Developer Skills

I occasionally run into or hear about, a PHP developer that claims to be a designer and a developer or maybe an expert Linux system administrator. I’m not saying they do not exist, however, they are rare. I like to separate the skill sets that are necessary for the successful launch and ultimately the support of any website.

Here are the 5 skill sets. Keep in mind there will be some overlap. The PHP programmer will probably have the greatest overlap given the developer needs to know a little about everything.

  • Designers – This is the person that makes your website look good. They create templates or what is called the theme. They know HTML and CSS very well and will have a good eye for making things look very nice.
  • Graphics Designer – Making logos, images, and modifying pictures are what this person does. The graphics designer and the designer might be the same person.
  • PHP Programmer – This person does not make your website beautiful, they make it functional.
  • Linux Hosting Administrator – Your hosting expert. They are the ones who maintain your hosting server and it’s associated network(s). 
  • JavaScript / AJAX developer – Making your website interactive is the function of the JavaScript / AJAX developer. Depending on the requirements of your website or web app, a PHP developer might fill this role. 

The Basics to Look For When Hiring a PHP Programmer

  • Skill Level and Experience – You are looking for a solution provider and I keep taking skills. I often hear “Employers are looking for skills and website owners are looking for solutions.”. That is true. So why do I continue to talk skills? It is simple. Solution providers must-have skills and experience.
  • We can group skills and experience is three basic buckets.
    • Entry Level – This is a developer who is just beginning. If we look just at time that might be the first two years of full-time work as a PHP developer.
    • Mid Level – Someone who has more than two years of full-time experience. 
    • Senior Level – A senior developer will be well seasoned. It might take six years to get to this point, depending on the type of projects they have been working on.
  • What Niche Are They in – This is important because you will want to find a developer that aligned with the niche your project is in. For example, if you are building an eCommerce website using WooCommerce you do not want to hire a Drupal developer unless that developer has WooComerce Experience.
  • Communication Skills – This is my pet peeve. The person you choose needs to have good communication skills. Add to that they need to communicate often. A developer with poor communication skills can derail a project in a heartbeat.
  • Ability to Self Motivate – Your developer will be working from home and must be self-directed and have the ability to motivate themselves even when they do not want to work on your project.
  • Ability to Run A Small Business – Every person who does freelance work must understand the basics of running a small business. The basics consist of managing projects, writing contracts, completing projects, billing and managing income and expenses. It sounds easy and it kind of is, however, this means the developer you hire must be good at changing hats as needed.

An Overview of the Technical Skills a Freelance PHP Programmer Must Have

As I outlined in the prior section, there is a division of skills. Most developers do one or the other well while having some skills in other areas. However, you will find that some if not most designers know little about PHP development. 

As for the PHP programmer, I would expect them to have a decent grasp of the full stack. Some refer to the stack as the “LAMP” stack. The LAMP stack is actually a subsection of what is really required of a freelance PHP programmer. LAMP stands for Linux, Apache MySql, and PHP. 

This does not mean the PHP developer is an expert in these ancillary technologies. What it means is the developer needs to know enough to be able to add the PHP / MySql functionality to other’s work.  

This is a brief summary of the skills a PHP developer must-have. This is not an exhaustive explanation of each technology.

HTML – The basis of all web pages.

CSS – The definition of webpage styles such as the font family and size. 

JavaScript and JavaScript Libraries – These add interactivity to your web pages.

Asynchronous JavaScript and XML (AJAX) – Allows your web pages to talk directly with the server. 

PHP – The programming language we are talking about.

MySql – The data engine. This includes the Structured Query Language (SQL).

Linux Hosting Provider – Linux is the hosting server operating system.

Data Management Tools – phpMyAdmin and the MySql tool used to manage your website data.

Code Editor – Must have an editor that helps the developer speed up the process.

I intentionally left off Windows PHP hosting because PHP is native to Linux and was adapted to run on the Windows web server. I would never recommend running PHP on a Windows server. 

The PHP / MySql developer needs to be rather skilled in many areas while designers, JavaScript programmers, and Linux administrators, for the most part, only need to know their niche.

There is an exception and that is specialty hosting houses where the Linux Hosting Specialist is also somewhat of an expert in the software being hosted. For example, I supported a company that had a Drupal install that they used as a content management system. The hosting admins were also skilled in Drupal and were part of the solution.

Education is Always Nice

When I started a Bachelor’s degree was required. Today a degree s not necessary. For what it is worth I learned the basics of programming at my local community college. I pursued a Bachelor’s degree because I thought the University was going to reveal the secret sauce. No secret sauce was revealed. All of my web skills have been self-taught or learned while doing projects. 

Believe it or not, PHP programming is not taught at the University. You will find website skills being taught at the community college level. 

Soft Skills

  • Leadership Skills – Your developer will need to take the lead in almost all areas of your project.
  • Teamwork – Even though you are hiring a Freelance developer, he or she is part of your team. They do their part while you do your part. It is a team effort.
  • Communication Skills – As mentioned before your developer must be a good communicator otherwise your project will fail.
  • Work Ethic – This speaks to being a self-starter. Since your developer will be working remotely, the must have a strong work ethic.
  • Flexibility/Adaptability – Things change often and your developer must be willing and able to adapt to change. Having a change procedure and policy will be very helpful. 

Freelance Developers Work Remote

Why is this important? Because the developer you hire must have a professional work environment, all the necessary tools, and be self-motivated. The person you hire will need to be able to work remotely with little direction.

Project Life Cycle

The project life cycle consists of four parts:

  • Initiation – The very beginning step is to determine if the project is viable, or feasible. If you have a small project, you may be able to do this in your head. However, it is always a good idea to write it down and think it through. You need to understand the pros and cons of your prospective project.
  • Planning – You will need the assistance of a senior developer to accomplish the planning phase. I assume you are a layperson that is why you are reading this article. Given that you will need to work with a developer to sort out the technical details and to determine how long the project will take the cost and the required resources.
  • Execution – This is when you are working on the project. You should be following the project plan and managing any changes that may come to light. Even the best of plans do not allot for everything. Occasionally there will need to be a change order. 
  • Closure – When the project comes to a close, it is time to assess your project to ensure your plan has been executed properly. At this point, you should have a good idea or even a written plan for what it will take to keep your web project online and functioning properly for the time frame you desire.

Technology Life Cycle

When I talk about the Technology Life Cycle I am talking about the upgrades of each piece of technology you are using. This may drive changes to your software as well.

A PHP project consists of a stack of interacting technologies. Each of these technologies has its own upgrade schedule. This can be complicated and this is where your developer and hosting partner play a major role. You may need to bring in your designer as well. If you did not use your PHP developer to perform your JavaScript programming, you will need that person to freshen up your JavaScript from time to time. 

You will be using the usual combination of technologies such as HTML, CSS, JavaScript and JavaScript Libraries, AJAX, PHP, MySql, and Linux. 

Any other libraries or software you use may come with its own upgrade schedule as well.

Keeping everything up to date and knowing when to upgrade is the job of your developer and hosting partner. For a small project, all of this may fall on the shoulders of your developer.

Application Security

Security is a must when dealing with the hostile Internet. Getting hacked is no fun. Most modern PHP applications such as WordPress come with builtin functionality that can be tapped into to ensure your application is secure.

The PHP programming itself has a whole layer of security that can be used to ensure your application is secure.

Programming Language Selection

If you have a project in mind and are not sure what programming language to use, a developer can help you with that. Given PHP is run on about 80% of the websites and applications on the Internet, PHP probably can do the job.

Hosting Selection

There are three types of hosting server configuration:

  • Shared Hosting – Hosting providers put lots of websites on each servers creating low cost hosting solutions. Shared hosting is a good place to start with a new project unless your project needs advanced access to the server such as command-line access. Some web applications can require more resources than shared hosting provides.
  • Virtual Private Servers (VPS) – This is where a server is partitioned into multiple virtual servers. Most web applications will run nicely on a VPS. 
  • Hardware Servers – Top-level applications may require the power and the exclusive use of a hardware server. This is a server that is exclusively used by one entity.

Your developer should understand hosting and can help you rightsize your hosting server.

How Search Engine Optimization (SEO) Knowledge Makes for a Better Developer

There is a lot to know when it comes to SEO. I think all PHP developers should understand the SEO basics. Things like using relevant search terms in places like the alt tags of your images.

They should also know about duplicate content, how the title of your articles will affect ranking, and so much more. 

SEO is easy to learn if one knows and understands HTML. 

So how does knowing SEO help? As your developer changes things they will understand what SEO questions to ask and how to use that knowledge to help your website SEO wise. 

For example, if you are using WordPress, your developer can help you configure things like your website Permalinks. 

Newsletter Management

This speaks to understanding SPF and DMARC DNS records. Knowledge of how newsletters are rejected by the recipient’s server and how to take corrective action is also important. This is an advanced topic and I would expect a seasoned programmer to understand these concepts. 

Backup Management

Losing a website can be catastrophic. Losing your website could put you out of business. Backing up your website data, files, email, and in some cases server configuration files is a must. Your developer needs to help you develop a comprehensive backup plan as well as help you implement it.

Networking and DNS

Every website or web application is on a web server. Every web server is connected to the Internet. A basic understanding of networking and DNS is are essential skill sets of a PHP programmer.

What specialty are you looking for?

If already have a website or have a plan that utilizes a certain technology, then you will want to evaluate and hire someone who is a developer in that niche. Below I write about some of these areas, such as WordPress, Drupal, and Joomla.

PHP Frameworks

Using a framework for a project usually indicates you have a custom web application.

Having an existing website or web application created in a certain framework will indicate what skills your developer should have.

The Good, the Bad, and Ugly of the Job Boards

When I went out on my own in 2006 there were no job boards. The gig economy has presented the need for a market place where developers can market themselves.

A job board or market place is a place where developers and others can offer their services for hire. The board handles all communication. There is no direct communication between you and the prospective developer. All communications are managed by the job board. Once you select a developer, your payments will be made to the broad and will be placed in escrow until you are satisfied with the job. 

The Good – You have a system in place that might protect you. Your money is placed in escrow. It is easy to find people with the skills you are looking for and read their reviews.

The Bad – These sites are bureaucratic. You must communicate with your provider through the website. The broker website gets a cut of your project, so your developer will be paid less.

The Ugly – There may be rules in place that favor the developer. You will never meet the prospect nor can you build rapport with that developer. These boards lend themselves to cheap and short projects. 

If you want to find an independent/freelance programmer you probably want to steer clear of these boards. You will need to be able to work directly with your developer, especially if it is a project that may take more than a few hours. 

White Label Consulting

If you are a freelance designer or an agency you may need to hire a developer and brand their work as your own. Most of everything I write in this article applies. 

Depending on your need you may want to build a network of programmers you can rely on. 

Milestones and Payments

I like to use a contract as an agreement for the project that outlines what is to be done, who is to delivers what, when certain milestones should occur, and when payments will be made. I also like to agree on the method of payment.

This agreement supersedes all prior statements verbal or written statements. Making the contract or agreement the final statement will help reduce misunderstandings. 

Problem Solving

By the time a person becomes a freelance PHP developer, they should be good at problem-solving. They should have a history of problem-solving. I’m talking about full-stack problem-solving. Full-stack means all the technologies that come together to make your website or web application viable. 

Employers look for skills and those hiring a freelancer are looking for solutions You are looking for solutions and you should understand the skills a freelance developer should possess to be able to complete your project. 

Problem-solving is not limited to the stack. Your developer may find themselves in a position to resolve other issues that are not purely related to programming. Freelancers must be ready to solve logistics and communications issues as well.

Hire a Freelance PHP Developer

If you have a generic problem, such as an old school website that needs to be freshened up a bit, you just need a PHP developer. Any PHP developer that has any amount of experience will probably do. Just make sure you find someone who knows what they are doing, is responsible and reliable. 

Hire a Freelance WordPress Developer

WordPress Logo

If you have a WordPress project, you will need a person who specializes in WordPress. While WordPress is easy to use and expand, it comes with a large ecosystem. Besides needing to know the basics and advanced PHP development, the WordPress developer needs to understand how to create plugins, how to write and modify theme code, and build or modify theme function files. A WordPress developer needs both advanced skills and WordPress specific skills. 

Hire a Freelance Laravel Developer

laravel logo

Laravel is an advanced PHP framework that is very popular. A Laravel developer needs advanced PHP developer skills and needs at least some Laravel development experience. Laravel requires the following skills:

  • Linux hosting command line
  • PHP Composer
  • Mod_rewrite
  • .htaccess
  • Potentially Apache and / or Nginx
  • Model View Controller MVC architecture

Just to mention a few.

Hire a Freelance CodeIgniter Developer

CodeIgniter is very mature given it was first released on February 28, 2006. It is very easy to install, run, and to build web applications with. CodeIgniter is my favorite PHP framework given its small footprint, lightning-fast speed, and it’s simplicity.

CodeIgniter can be used to develop web applications on shared hosting since it does not require a lot of resources nor is there any need to have access to the server command line.  

It is well documented. It follows the Model, View, Controller (MVC) architecture. Codeigniter is suitable for almost any type of project.

A Codeigniter developer needs moderate experience and skills. 

Hire a Freelance WooCommerce Developer

WooCommerce is a WordPress plugin. It extends WordPress. A WooCommerce developer will need to be a WordPress developer and will need WooCommerce skills as well. This developer will need advanced PHP skills first and foremost. Add to that you will want someone with eCommerce experience and a good understanding of the Domain Name System (DNS). It would also be a good idea to hire a developer with some understanding of how a newsletter system works and how SPF records work.

Add to these requirements an eCommerce expert needs to have knowledge and experience with the Payment Card Industry (PCI) standards. This includes penetration testing and working knowledge of how Internet taxing works.

Hire a Freelance Drupal Developer

Drupal is very mature and is for the enterprise. Drupal has a large ecosystem and is a very hardy web application infrastructure that lends itself to creating Content Management Systems (CMS) and all sorts of web applications. Drupal comes with a long and difficult learning curve. Out of the box, Drupal is not very SEO friendly. 

If you are looking to hire a Drupal developer look for someone with a lot of experience with Drupal that is an advance PHP Developer. This person will need to have Linux command-line skills and understand Composure. There is a lot to know to become a freelance Drupal developer. 

Hire a Freelance Magento Developer

Magento is Open Source and also has a licensed version. Magento comes with an extreme learning curve that includes understanding Dependency Injection, Name Spaces, Composure, Payment Gateways, and the Linux command line, Apache and/or Nginx.

Magento is a resource hog and you will probably want to use Magento specialized hosting. 

A Magento developer will need to understand all the design patterns used in Magento to include the database model Entity–Attribute–Value model (EAV).

I think Magento is such a complicated application that I would steer away from a one-man-band freelance developer. I would look for an agency with a proven track record. 

Hire a Freelance PHP Browser-Based Applications Developer

To develop PHP browser-based web applications, your developer will need to have more than a basic understanding of JavaScript / AJAX, and at least one JavaScript library such as jQuery. This developer will need to be an advanced PHP developer and will need to be skilled in making applications that run in a web browser that can rival desktop applications with features like pop up forms and interactive forms. This developer will need to understand security and networking.

What You Can Expect it Will Cost to Hire a Freelance PHP Developer

What does it cost to hire a freelance PHP Developer? It depends on a number of factors, such as what type of application or website you would like to build, the skill set of the developer and where they are in the world. An entry-level American developer might charge $40 an hour and an experienced developer might want upwards of $200 an hour depending on the project and the required skills. An offshore developer might charge as little as $12 per hour and will come with lots of challenges.

In Conclusion

If you have made it this far, you know there is a lot to take into consideration when hiring a freelance PHP developer. Understanding your project and what specialty you need is important. Can you live with a high school kid, or do you want a pro? Understand the prospective developer’s skill and experience level is always good. 

I would recommend you read and reread this article before you decide to begin your search.

I wish you much success in your search for a developer.