Get The Info – PHPinfo
Oftentimes, when you want to install a PHP powered program or function on your website, such as WordPress blog software, or a traffic tracking routine, or tens of thousands of other useful things out there written in PHP, they usually include ‘requires xxx’ where xxx might be about anything supported by PHP. Sometimes it is a particular version of PHP (some programs now require PHP5, while most installations are still 4.something). Other times it is an optional library within PHP like gd, a library of image manipulation routines; or it might require PHP be compiled with or without ‘magic quotes’. How do you find out if your version of PHP has the required parameters?
Simple — run phpinfo. The easiest way to do this is to open cpanel or whatever control panel your host supports, and open the file manager. Click on ‘new file’ and create one with a .php ending — call it anything you like, info.php for example. Then open that new file from within the file manager, and put this one line in it:
<?php infophp();?>
Open your web browser to the your site where you added that file, and add the filename (like info.php) to the end of the URL. Press enter and you will get a long page with every configuration detail about your version of PHP that you could desire. Save the file to your personal computer, then go back to the file manager and delete it — you don’t want a hacker to get access to that kind of detailed information about your site’s configuration.
Look for any configuration requirements within that vast list of parameters using the search function of your browser, and you should be able to easily determine if your setup will run the PHP script you are investigating.
Filed under: Functions | Leave a Comment
Search
-
You are currently browsing the PHP Basics weblog archives.
No Responses Yet to “Get The Info – PHPinfo”