How to Create and view phpinfo file in Linux

Linux phpinfo in Linux 222 times1 answer1 follower
0
Mel Khamlichi 103 Rep. Avishek Kumar edited question

What is phpinfo file and how to create it? can I run phpinfo in web-browser? I need to check the configuration and see information on php modules.

♥ Spread the love ♥
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
0
Avishek Kumar 449 Rep. Avishek Kumar edited answer

phpinfo can be seen in web browser as well as in Linux terminal. Here I will tell you both the methods

See phpinfo in Web Browser

  1. Find apache working Directory
  2. The default Apache(Httpd) working directory is ‘/var/www/html’. If you are not sure, you may find it as below.

    On Debian and derivatives

    Sample Output

    On CentOS/Fedora

    Sample Output

  3. Goto your Apache working directory
  4. or

    or whatever it is in your case

  5. Copy and paste the below content as it is
  6. All done. Goto http://localhost/phpinfo.php in your favorite browser. You should be able to see something like below.

    Alternatively, you can see phpinfo in command-line as well.

    See phpinfo in Linux Terminal

    Sample Output

    ♥ Spread the love ♥
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
×

Login