How to install PHP and MySQL on Linux OS

 

Inarguably, web development is as interesting as it is challenging. It requires great ingenuity and understanding to handle the various tools, utilities and applications that are available for web geeks. One of the challenges has to do with how to perform the installation of PHP and MySQL on a Linux operating system, and that is what this page seeks to address in a simple way that both the beginners and the expert will appreciate.
Usually, beginners who are quite new to the development of web application in PHP may experience some difficulties when it comes to the installation of PHP and MySQL on a Linux operating system. Even, those who are experienced in this task needs some caution.
Typically, simple steps are involved in the installation of PHP and MySQL as long as Linux itself as an OS has been properly installed on the system. It is worth nothing that certain distributions like Ubuntu, Suse Linux and CentOS are readily suitable for web applications. Therefore, such version would make the entire process more easier and friendly.
First and foremost, the web server is the first thing to be installed on the system. For a Linux system, a typical Apache server is usually preferred as it completes the LAMP architecture (Linux, Apache, MySQL, PHP). If you are using the CentOS distribution, you have to open the terminal window and then type “yum install httpd” in order to install the web server. Then, careful follow the subsequent set of instructions one step at a time.
After having installed the web server, proceed with the installation of your PHP module on it. As for the CentOS, simply type “yum install php”. Follow the installation instructions step by step.
The final step for the procedure is the installation of the MySQL. Type “yum install mysql-server mysql” and follow the series of instructions to completely install your MySQL server. Once the database is installed, the Apache server can be started by using the following command line:
“service httpd start”
Provided that the web server service is properly started, there would be a display of the notification on the screen to that effect. Then, the next step is starting the MySQL server by typing the following command in the terminal window:
“ service mysqld start”
Now, after starting the two installed servers, just go to its “localhost” page to confirm whether the Cent OS welcome page is displayed in the browser or not. It simply verifies the correctness of the installation.
Moreover, the PHP status needs to be checked. It requires the creation of a similar PHP page that would perform the phpinfo() method of printing. If the PHP info page is purple in color, then the module is working correctly, running actively on the server at that point in time. If not, there may be the need to check for some installation bugs and fix things up.
The development of web applications with the use of PHP and MySQL is technical, but following the above steps carefully will save the user from hassles, provided that other necessary utilities, tools and compilers are already in place within the system.