Create a PHP info Test Page on Command Line

This will create a PHP info page so that you can test if your PHP server is working.

This test file will be created quickly using the command line.

Open a terminal and type:

echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/test.php 

Open your web browser and type in the address bar “localhost/test.php” and press ‘enter’. You should see the PHP Info page. This shows that your PHP server is working.

Once the PHP server is working fine we don’t need that test file anymore, so type the following command in your terminal to delete the file:

sudo rm /var/www/html/test.php

See more: ,


Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this: