Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»How to Create and Access phpinfo() File

    How to Create and Access phpinfo() File

    RahulBy RahulJuly 29, 20202 Mins ReadUpdated:July 31, 2020

    The phpinfo() is the core function of PHP. It prints detailed information about the current stat and configuration of PHP on server. With the help of phpinfo, you can find the PHP version, modules and there version and configuration options.

    This tutorial will help you to create a php script with phpinfo() function and access it.

    Pre-Requsities

    We assume you already have installed PHP and a Web server on your system.

    Create File with PHPINFO()

    You need to find default ducument root of your Web server. Also, you can use document root of any domain configured with the web server and pointed to it.

    In my case, I create a php script at below location:

    sudo vim /var/www/html/phpinfo.php
    

    Add below content to the file:

    PHP
    1
    2
    3
    <?php
      phpinfo();
    ?>

    Save your file and close it.

    Next, you need to set proper permissions on your file to be accessible by your web server.

    sudo chmod 755 /var/www/html/phpinfo.php
    sudo chown www-data:www-data /var/www/html/phpinfo.php
    

    Change www-data with the username of your web server running with.

    Access PHPINFO() Script

    Your phpinfo script is ready to access. You can access above created file in a web brower with your server ip address or configured domain name.

    http://server-ip/phpinfo.php

    Createing phpinfo() function script
    Output of phpinfo() function
    PHP
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install and Configure Sysstat on Ubuntu 20.04
    Next Article How To Install ionCube with PHP in Ubuntu 20.04

    Related Posts

    How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04

    Updated:May 9, 20223 Mins Read

    How to Find Django Install Location in Linux

    Updated:April 27, 20221 Min Read

    (Resolved) – ReactJS 404 Error on Page Reload

    2 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    Adding a New SSH Key in GitHub

    Updated:April 1, 20223 Mins Read

    13 Best Linux Terminal Emulators and Bash Editors

    8 Mins Read

    1 Comment

    1. Toto on February 16, 2021 5:24 am

      I am using CentOS 8. Can I do this and access it through hostname remotely?

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.