How Do You Install Zabbix Server on RHEL 7.x Running in AWS?

Problem scenario
You have a RedHat Linux server with only 1 vCPU and 1 GB of RAM.  You want to install Zabbix Server to monitor other servers.  How do you deploy Zabbix server to an AWS instance of RHEL?

Solution
1. Install the LAMP stack components by running this command:
sudo yum -y install php httpd mariadb-server

2.  Install essential Zabbix components with these four commands:
sudo rpm –import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX

sudo rpm -Uv 

Why Does PHP Return “Resource Id #2” Or “Resource Id #3”?

Problem scenario
In a LAPP stack deployment, a PHP variable is displaying a value “Resource id #2” or “Resource id #3.”  You are expecting a different value.  The PHP variable having the problem is the result of a SQL command ran against a PostgreSQL database.  What should you do?

Solution
Assuming that $var1 is displaying the undesirable “Resource id #2” or “Resource id #3”,

How Do You Have Text Fields That Have Hints (Suggested Text)?

Problem scenario
You are using PHP files (with HTML).  You have text fields that are blank by default.  These fields accept user input from the keyboard.  You want the clear text fields to have suggested text by default (to help explain to the user the type of input that is appropriate or to remind the user of content restrictions).  How do you do this?

You have a field that requests text like this HTML code (in a .php file):

<html>

How Do You Create an Option to Logout for a PHP Web Page to Destroy the Session?

Problem scenario
You have a LAMP (or LAPP) web page application.  The PHP code uses the session() functionality.  Once a user logs in successfully, he/she can browse to successive web pages.  You want to at least allow the user the opportunity to destroy the session (and terminate the authentication session).  How do you do this?

Solution
#1  Modify the .php file that you want to have the logout feature. 

How Do You Configure the LAPP Stack to Authenticate and Allow Subsequent Pages Navigable Based on the Original Authentication?

Problem scenario
You are deploying a LAPP (Linux, Apache, PostgreSQL, and PHP) stack. You want the authentication to be done via a Postgres database behind-the-scenes.  You can control the credentials from the back end this way.  You want the user to be able to click around in the application once logged in.  You want only one challenge for user login credentials.  

How do you create a PHP login page (i.e.,

How Do You Troubleshoot a 500 URL Return Code with a PHP Web Page That Is Using pg_connect?

Problem scenario
You have an Apache web server with PHP code.  You are trying to integrate web pages with Postgresql.  When browsing to a web page (.php), you are getting a 500 URL return code.  Your PHP web page file is using the reserved command “pg_connect.”  How do you overcome this 500 URL return code error and have the web page work?

Solution
Possible solution #1:  Reboot the web server.

How Do You Fix the Problem “Unable to locate package php-pgsql”?

Problem scenario
You are trying to integrate PHP and Postgresql on you Ubuntu/Debian Linux OS.  You run this command:  sudo apt-get -y install ​php-pgsql

You receive this error:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package ​php-pgsql

What should you do?

Solution
#1  Find out what version of php you have. 

How Do You Troubleshoot a PHP Page Showing the Raw Code in a Web Browser?

Problem scenario
You created a PHP web page, but it is not rendering correctly in a web browser.  You see the raw PHP code or text.  What do you do to get the PHP to display correctly as a web UI (and not raw code and uninterpreted text)?

Solution
Possible solution #1
Install PHP.  For assistance with installing it on a Debian/Ubuntu server,

How Do You Get PHP to Have a Separate Line for an Input Field in a Submit Form?

Problem scenario
In a PHP “submit form” you have various fields.  Two of the fields are on the same row.  That is, when you open the page with a web browser, two input box fields are the same distance from the top and bottom of the page.  You want each field to be on its own line.  How do you do you get the PHP form to render the way you want?

How Do You Have PHP Return an Informative Error Message When a SQL Command Returns No Results?

Problem scenario
You have a PHP web page that integrates with Postgres behind the scenes.  You find that when a SQL command returns nothing (e.g., when a table name is used and it is known to not exist in the underlying database), the PHP web page is blank.  You want the result to be more clear about what happened or potentially happened.  How do you handle an exception or commonly occurring SQL query with no results using PHP?