Once connected to the MySQL database, PHP will retrieve the information and process it for display on the Apache webserver.
1. Install the MySQL extension along with PHP, again using the yum package installer, with the command:
sudo yum install php php-mysql
You should now receive a Y/n prompt, allowing you to confirm the installation by entering Y.
2. To make your Apache phone number library web server coexist with PHP, restart the server:
Step 6. Test PHP processing
In order to find and serve a website, Apache must save the file in the webroot.
Using nano or vim editor, you can go to this directory and run a PHP test on CentOS 7 server.
1. To install vim editor use this command:
sudo yum install vim
2. Use a basic PHP script to create the info.php file with the command:
3. An empty text file will open, in which you have to press the I button, copy, and paste the following:
4. Press ESC (to exit), SHIFT + Q and enter qw + ENTER (to save changes and close the file).