Buying for a Team? Gift This Course
Wishlisted Wishlist

Please confirm that you want to add PHP Shell Scripting for Linux/Unix Administrators to your Wishlist.

Add to Wishlist

PHP Shell Scripting for Linux/Unix Administrators

Learn how to use PHP for powerful shell scripting, and web based reporting.
0.0 (0 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
35 students enrolled
Created by Sam Gill
Last updated 11/2015
$10 $20 50% off
2 days left at this price!
30-Day Money-Back Guarantee
  • 2 hours on-demand video
  • 5 Articles
  • 5 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Have a coupon?
What Will I Learn?
Learn PHP Shell Scripting
Learn by Example
Learn by Examining Code
Learn by Real-Use case
Learn to write PHP Shell Scripts, and Web-based tools.
View Curriculum
  • Have access to a terminal or command line prompt.
  • Prior shell scripting is helpful, or knowledge of the command line is helpful.

Hello, and thank you for you interest in this course. I have been programming PHP since 2000. I have also been a Linux/Unix Administrator since 2000. I have worked with PHP in Shell script applications and Web-Based applications since 2000 as well.

I have written many tools, and managed over 600 servers, and built Linux environments from 2 servers to over 200, in less than 2 years. I have a lot of industry experience, and now I want to share this knowledge with you, so that it can help your career.

In my early days, I was in-between C and Java, and I choose C, and even C over C++, because I was more interested in the systems language that Linux was written in. I grew found of PHP mostly due to its C-like syntax. In fact it is like C, but much easier to pick up. There are no type declarations, or linking, or compiling. It is very easy to go from C to PHP, since most of the functions and operators work the same.

However PHP is even better, since you can write it inline with Web-Based HTML. It makes sys admin work, and web-based reports, only needing to know one language to do both jobs.

With the helper functions that I show you in the course, you will learn how easy it is to turn command line tools, into objects PHP can easily harness. With this you will be able to write scripts fast and quick.

My largest installation of PHP grown scripts, was at a company, where I scripted so much through PHP, that it would have taken 3 full-time people to replace what I had written.

Never fear running out of work, I was always busy at that job, and I never ran out of work, that is why I had scripted so much, just to get ahead and stay afloat. PHP is a powerful language. You can hardness data, and send it right into a database, in fact PHP libraries work with just about every database on the market, making it great glue code to import and export between different platforms.

Enroll now, and let's get started putting PHP to work for you, and letting it enhance and move your career forward.

Who is the target audience?
  • Unix/Linux Administrators wanting more powerful scripts than Bash/Korn
  • PHP Coders looking to automate tasks in Unix/Linux
  • If you have written PHP code, I will show you how to modify it for the command line.
  • This is not a web development course.
Students Who Viewed This Course Also Viewed
Curriculum For This Course
Expand All 41 Lectures Collapse All 41 Lectures 02:10:39
Course Introduction
1 Lecture 03:50

Introduction to PHP Shell Scripting for Linux/Unix Administrators. This course covers helping Unix/Linux Administrators learn about PHP shell scripts. You will learn how to code, and how to convert shell scripts to PHP, and how to use PHP for Web-Based applications.

Preview 03:50
Intro to PHP Scripting
6 Lectures 07:38

This section is a brief overview of PHP, and some system related aspects of PHP, that are helpful to know.

Preview 02:02

PHP is an interpreted language, here are some things to understand about PHP, as opposed to or like PERL.

Preview 01:45

The unique advantage of PHP, is that you can easily run it over the command line, or through mod_php in apache. Php is also adapt to database connections, with a modern library of current database support.

Preview 00:49

INI Files are the basis for global PHP configuration, here is where to find them on the system.

Find the Location of PHP INI Files

The most common values that need to be changed in a PHP INI file are listed in this lesson.

Modify the Most Common PHP INI Values

Intro to PHP Quiz

Intro to PHP Quiz
3 questions

Introduction File Zips
PHP By Example
7 Lectures 35:12

In this section we look at a working script, which compares the contents of two files, they are actually database table dumps, and the script goes and determines which tables are missing from the other file.

Preview 00:20

First we start with a script, that is written, and explore what it does.

Examine a PHP Script

Looking at the files we are searching for, we begin to further understand what the script is doing, and learn about refined parsing methods.

Explore More About Parsing

Looking further still we examine and explore the rest of the file, and make deductions about what we might want to change later on.

Dig Deeper Into What the Script is Doing

Now that we understand a bit about the script, we start to modify it, by employing a function to reduce and reuse code.

Make Modifications to the Script

Now we go and look at some web resources, a good place to find some help.

Find Resources on the Web

PHP Example Quiz

PHP Example Quiz
2 questions

Example File Zips
PHP By Coding
11 Lectures 44:48

Now we are going to learn PHP, by building a script.

Preview 00:17

Let's look at a design template.

A PHP Template Script

Lets turn some code into a function.

Turning Code into a Function

This is my most valuable too, the syscall function. Let's learn how it works, and what it allows us to do.

The Syscall Function

Let's replace the system call with syscall, and measure the result.

Replacing System with Syscall

Look at ways to implement flexible array processing.

Flexible Array Processing

Add a search variable, so that you can easily change what you are searching for.

Adding a Search Variable

Instead of one search term, turn that into a passable array.

Utilizing a Search Term Array

We look at another way to loop through an array.

An Alternate Loop, and a Look at Scope

Utilize command line arguments to add flexibility to your program.

Integrating with Command Line Arguments

PHP Coding Quiz

PHP Coding Quiz
4 questions

Coding File Zips
PHP By Conversion
7 Lectures 15:08

An introduction into converting a bash script into a PHP script.

Preview 00:24

Lets take a look at the bash script we are going to convert.

Bash Script to Convert

Convert commands to variables.

Convert Commands to Variables

Use this PHP feature to debug arrays.

Using Print_r to Debug

Add the Convert FD functionality.

Adding FD Functionality

We adjust PHP to match the output formatting, so we get the same functionality as we did with the bash script.

Matching the Output Formatting

Conversion Quiz

Conversion Quiz
2 questions

Conversion File Zips
PHP Real-Life Use Case
9 Lectures 24:03

Let's talk about a real-world use case, and discuss how to solve the problem.

Preview 00:50

Here is a script, which makes a config file, that the main script will use.

Script to Make a Config File

To view the config file, we write a short script to display its contents.

Viewing the Config File

Now we take an in-depth look at the main script, and see how to access the data in the config file.

How the Main Script Works

Here is how to configure PHP to send mail. This library works great!

PHP Mail Configuration

Here is where I got the mail library from, download yourself a copy as well.

PHP Mail Library

Here is a look at the contents of the zip file, so you can examine what the output files look like.

Contents of the Zip Files

It is always good to use a debug file, this catches all the standard output from the cron job.

Use of the Debug Output

Real-World Quiz

Real-World Quiz
4 questions

Real-Life File Zips
About the Instructor
2.8 Average rating
13 Reviews
143 Students
13 Courses
Instructor, Sr. Consultant, Executive Director, Producer

I have been making music, since 1992. I have 3 labels, and 2 bands. I have programmed and written over 800 sequences, and when I have time, write about 80-100 songs a year. At one point I owned 19 keyboard synths, and 20+ synth rack modules. I used to record and arrange on a setup that consisted of a 24 channel Soundcraft, with 3 DA-88's and a Roland MC-50Mk2. I came to Logic and Apple in 2007, and picked up Ableton Live in 2009. I sold most of my hardware, and bought in to soft-synths, after I sampled my most used sounds, and was able to reliably use those. I continue to write to this day, and keep learning new techniques, and new ways to improve my music. Now that I have amassed such knowledge, I have found the joy of sharing what I know with others who can benefit from my years of experience.

Beside music, I have worked with electronics since 1990, and have built, repaired and fixed many things along the way. I got really sucked into electronics, when my synth passion ignited, and I found out that they need to be repaired frequently. I started repairing synths as early as 1998, learning about the ins and outs of the electronics that they were founded on.

I took an interest in programming keyboards, with my first programmable keyboard, which was a Kawai K11, which I bought in 1992. I did not know it then, but programming a keyboard, and programming a computer, are not very far off.

In 1994, I bought my one and only sequencer, a Roland MC50-Mk2, which I have to this day, and it writes in DD floppy drives. I have a collection of DD drives, since they are not easily found today. I composed over 800 sequences on that sequencer over a 10 year period. I learned how to arrange, and that arrangement method was directly transferrable to Ableton Live.

Since 1984 I also been an avid Photographer, and have invested in cameras, lenses, video equipment, and other sorts of gear, to not only share what I know, but how I think. Over time I have also developed a deeper spiritual sense, that has come to offer comfort, to those I hold dear, and has helped me to achieve peace within myself. I have published my photography works, and use my photography skills for a number of different uses. I also will have courses on photography and video techniques, to share, ones that I have learned over the years.

In 2007, I began to build up my contemplative skills, and began to think more about the world, and who I was. In 2011, I was forced to speed up this process, and went through a number of breakthroughs, and revelations. In 2013, and into 2014, I experienced spiritual awakening, in new and different ways, and had a lot of my beliefs turned upside down, or replaced, or expanded. As you may have guessed, I have now a lot to talk about on this issue, and I will be making courses for self-development, and personal development, along with helping you to understand some of the things that you may be going through, and how to cope or grow beyond them. Hope is always possible, in all situations, and a better outcome can always be pursued.

If you have a course that you would like me to teach, just send me a note, and I will add it to my list. I am always looking to help others, and mentor people, as I have the time. I hope that I have been able to help you, and grow your skills and talents, as you look for ways to express them.

I hope you enjoy watching and learning from these courses, as much as I enjoy teaching them. Be well, and take care my friend.

Report Abuse