How to Easily Create and Use a phpinfo Page ? | GreggHosting

The affects of Web Hosts on Your Business Website

Here're ways your choice of web hosting service provider impacts the performance of your business:


check

Website loading speed

check

Uptime and availability

check

Customer support

check

Security

check

Server location

How to Easily Create and Use a php info Page (In 3 Steps)

How to Easily Create and Use a php info Page (In 3 Steps)

php info Page

User-Friendly PHP Info Page

For WordPress users, PHP is an essential coding language. Even if you’re not a developer, you may need to know a little about it to keep your site up to date. Finding even the most basic PHP information for your WordPress installation might be difficult if you don’t know where to search.

Fortunately, if you spend a few minutes setting it up, you can build a single page that has all of the PHP information you require. Even better, all it needs is a single line of code.

In this article, we’ll go through the php info() function and why it might be valuable to you. Then we’ll teach you how to make a php info page for your WordPress site with it.

Let’s get this party started!

Contents Table of Contents

An Introduction to the phpinfo() Function

What is a phpinfo Page and How Do I Make One? (In 3 Steps)
The phpinfo() Function: An Overview
phpinfo() is a PHP function that takes one or more parameters and returns a value. When you run phpinfo(), it will provide you information about your site’s PHP settings, including:

The PHP version that your site is using right now.
Information about your server and its surroundings.
PHP’s working environment.
Information about the version of your operating system (OS).
Paths, including php.ini’s location.
For PHP configuration settings, there are master and local values.
Headers on the HTTP protocol.
PHP’s license.
Currently used modules and extensions.
When you use the function by itself, it will return all of the information that is available. There are, however, a few factors you may use to limit your access to only the information you wish to see. These are some of them:

INFO GENERAL: Shows the configuration line, web server, operating system, and other information.
INFO CREDITS: Displays a list of PHP developers, modules, and other information.
The current local and master directives are returned by INFO CONFIGURATION.
INFO MODULES: All extensions and their settings are shared in this folder.
INFO ENVIRONMENT: This variable contains all information about the environment variables.
INFO VARIABLES: Displays all environment, GET, POST, Cookie, and Server variables (EGPCS).
The PHP License is displayed using the INFO LICENSE variable.
INFO ALL: Returns all information that is accessible (you can accomplish the same thing by using no parameters).
Creating a phpinfo page, as we’ll see later in this piece, is one approach to use the phpinfo() function. However, it’s worth noting that some of the information listed above can be found without going through the hassle of using that feature.

For instance, the WordPress Site Health feature, which is available in versions 5.2 and higher, can provide information about your web server, PHP version, memory limit, and other factors. To get this information, go to Tools > Site Health > Info > Server:

Plugin for Site Health
Site Health is a useful feature.
phpinfo() is better suited to assisting you with debugging attempts than checking for these pieces of information. This function is very useful in this aspect because it provides EGPCS data.

How to Increase PHP Memory Limit in WordPress is a recommended read.

How to Create a php info Page (In 3 Steps)

Creating a phpinfo page is actually pretty straightforward if you have a basic understanding of File Transfer Protocol (FTP) and how to use an FTP client. We’ve broken it down into three simple steps in the sections below.

Step 1: Create and upload a phpinfo.php file to your server.
Open your chosen text editor to begin making this page. Add the following line of code to a new document:

<?php

the phpinfo() function;

?> If you want to use one of the above-mentioned parameters, put it between the parentheses here. Save the file as “phpinfo.php” after that. You can give the file an other name if you wish (we’ll explain why in Step 3), but it must have the.php extension.

Do you want to discover how we grew our traffic by over 1000%?
Join the 20,000+ people who receive our weekly email with WordPress insider secrets!

Now is the time to subscribe.
Next, open FileZilla or another FTP client and use your FTP credentials to connect to your site’s server. Then, in the public html folder, upload your new phpinfo.php file:

Including the phpinfo.php file in the mix
You’ve finished adding the phpinfo page to your website. However, you’ll need to know where to look for the page in order to see it.

Step 2: Open your browser and go to the phpinfo page.
Your phpinfo page will be publically accessible once it has been published to your server. By attaching /phpinfo.php to the end of your site’s domain, you (and anyone else) can read it in a browser:

This is how the phpinfo page appears.

This page will be pretty extensive if you didn’t use any parameters and elected to return all of your PHP information. Using your computer’s Find function (CTRL or CMD + F), you can find the particular details you’re looking for:

Example of a find function
You can now utilize this information to perform any debugging or other actions that are required.

Are you fed up with poor level 1 WordPress Hosting support that doesn’t provide answers? Try our world-class customer service! Take a look at our plans.

Delete or rename your phpinfo page in step three.
Because your phpinfo.php file was placed in your public html folder, it is now publicly viewable, as we mentioned in Step 2. The issue is that some of the data returned by the phpinfo() function is sensitive and might be used by a malevolent hacker to obtain access to your server.

In order to exploit phpinfo pages, attackers may use bots to look for them. As a result, it’s recommended to remove yours once you’ve finished using it. Return to your FTP client to accomplish this.

Reconnect to your server and navigate to public html. Select Delete: from the context menu of your phpinfo.php file.

phpinfo.php is being deleted.
Some users, on the other hand, choose to rename their phpinfo page in order to keep it hidden from hackers. Instead of “phpinfo,” you may try a random string of letters and digits. It’s worth noting that this will also change the URL you use to access your phpinfo page.

This means you’ll have to remember the name you give your phpinfo page so you can access it at any time. However, because this isn’t a foolproof method of preventing a security breach, it’s preferable to build the page only when it’s needed and then erase it.

A phpinfo page collects a wealth of information about your PHP setup. Find out how to make one for your WordPress blog! CLICK HERE TO TWEET

Summary

The phpinfo() function can help you troubleshoot your site by providing useful information. Create a phpinfo page to examine all of your PHP information in your browser, which is a simple way to put it to good use.

To create and use this page safely, follow these three simple steps:

Create a file called phpinfo.php and upload it to your server via FTP.
Using your browser, go to your phpinfo page.
When you’re finished with your phpinfo page, delete or rename it.
Save time, money, and improve site performance by using:

Expert WordPress Hosting assistance is available 24 hours a day, 7 days a week.
Integration with Cloudflare Enterprise.
With 29 data centers across the world, we can reach a global audience.
With our built-in Application Performance Monitoring, you can improve your performance.
All of this and more is included in a single plan that includes no long-term obligations, aided migrations, and a 30-day money-back guarantee. Check out our plans or speak with a sales representative to find the ideal plan for you.