Testing the PHP installation

At this point, we need to test our website with PHP. This can be done by writing a simple PHP script page. If PHP is installed correctly, it will return information about its environment and configuration.

  1. Go to the next folder, where it's the root document:
            cd /var/www/html 
    
    
  2. Create a file called phpinfo.php.

    We use the word nano so that we can get into the file of the system with the privileges and execute the following command:

                sudo nano phpinfo.php
    
  3. After creating the file, as given in the following screenshot, press CTRL-X, and then save the file:
    Testing the PHP installation
  4. In your browser, enter the IP address of your Raspberry Pi, for example, http://192.168.1.105/phpinfo.php, and you should see the following screen:
    Testing the PHP installation
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.28.93