How Do You Troubleshoot PHP Not Displaying the Output of a Bash Command?

Problem scenario
You have a PHP program that works from the back-end (from a command terminal executing like php foobar.php). When you view the program in a web browser, it is not running the Bash commands properly. What should you do?

Solution
The root cause is probably the user execution context and a variety of permissions or configuration settings on the Linux system.

How Do You Write a PHP Web Page That Asks for a SQL Table Name Then Returns the Contents after the User Clicks a Button?

Problem scenario
You want users to be able to enter a table name and then see the content of the table.  How do you create a webpage with a text field and a submit button that will display the content of the table if it exists?

Solution
Overview
This assumes you have the LAPP stack set up on a single server.  To set up the LAPP stack on Ubuntu,

How Do You Return Basic Messages from a SQL Query to a PHP Web Page When Using LAPP?

Problem scenario
You have deployed the LAPP stack. You want a basic and meaningful message to be presented to a user of the web application after a SQL command has been run.  Currently a user can click on buttons to run SQL commands behind the scenes.  Messages that are returned to the user may be meaningless like “Resource id #4” or “Resource id #5.”  You want to augment the functionality so at least a rudimentary message (with some meaning) is returned to the user. 

How Do You Deploy LAMP with Ubuntu Linux?

Problem scenario
You want to deploy the LAMP stack on a Debian/Ubuntu distribution of Linux. You want to install and the four core technologies that compose the LAMP stack (Linux, Apache web server, MariaDB/MySQL, and PHP).   How do you do this?

Solution #1 (with MySQL)
To install the OS, Ubuntu Linux, see this link. To install MySQL run these commands:

sudo apt-get -y update
sudo apt-get -y install php apache2 mysql-server

# Provide a password for the mysql root user when prompted. …

What Are the Different Acronym Stacks in I.T.?

Question
What are the different acronym stacks in I.T.?

Answer
There are many open source combinations of technologies that are in wide use.  These acronyms referred to as “full stacks” or “stacks” appear in articles and job descriptions.  A full stack is a bundle of software that (includes an OS and) can create a complete and functional product when properly configured. 

How Do You Get an Apache Web Server to Publish a Specific .PHP File on a CentOS/RHEL/Fedora Server?

Problem scenario
You are using a RedHat derivative distribution of Linux.  You want to install Apache Web Server on it so it can publish PHP content.  How do you install and configure the necessary dependencies to do this?

Solution
1.  Install Apache web server:  sudo yum -y install httpd

2.  Install PHP:  sudo yum -y install php

3. 

How Do You Use PHP Variables in HTML?

Problem scenario
You have a .php file with PHP and HTML code.  You want an HTML text field to be display a pre-populated text value by default.  The user can then modify this value from the web UI (i.e., front-end).  You want this text value to be based on a PHP variable (calculated in earlier in the code).  How do you get your HTML code to display the value of a PHP variable?

How Do You Deploy a LAMP Stack Application Powered by Kubernetes?

Problem scenario
You want to deploy your own LAMP stack with the power of Kubernetes.  You do not want to rely on official Docker Hub images for the underlying Docker containers.  How do you do this?

Solution
1.  Deploy Kubernetes to AWS.  If you need help to deploy Kubernetes to AWS, see this link.  If you need assistance installing kubectl on any type of Linux (CentOS/RHEL/Fedora,

How Do You Prepopulate Text Fields in a Web Page with Values from a SQL Database?

Problem scenario
You have a web page from an .php file that includes HTML code.  There are fields visible in the web page to the user.  These fields accept text. You want the fields to not be blank; you want the fields to have suggested values of text in them. You want the data in the fields to be taken from the result of a SQL statement.  How do you prepopulate text fields in a LAPP web page with values from SQL statements?