Thursday, November 21, 2024
HomeEveryday WordPressFinding Enabled PHP Functions In Your WordPress Hosting Using phpinfo()

Finding Enabled PHP Functions In Your WordPress Hosting Using phpinfo()


WordPress runs on PHP, so as a WordPress developer, it’s important to understand the PHP functions enabled on the server that hosts your site(s).

Do you need to set up a plugin or configure an application on a WordPress site and are wondering if a certain PHP function or library is enabled on your server (e.g. cURL)?

In this tutorial, we’ll show you a quick and easy way to find enabled PHP functions on your server using the phpinfo() function in WordPress. We also provide a comprehensive glossary of these PHP functions for reference, and to help you better understand the backend of your WordPress sites.

This quick tutorial covers the following:

What is phpinfo()?

The phpinfo() function is a built-in PHP function that provides a long list of detailed information about the PHP installation and configuration settings on your server, including all the loaded extensions.

When phpinfo() is called and executed, it generates a comprehensive HTML page that displays various aspects of the PHP environment, including PHP version, extensions, directives, environment variables, and more.

The phpinfo() function outputs information in a tabular format, making it easy to navigate and understand the PHP configuration. This knowledge allows you to leverage the available functions on your hosting environment and optimize your WordPress development process.

The information displayed by phpinfo() can be categorized into different sections that provide specific details about a particular aspect of the PHP environment.

Some common information you can find using phpinfo() includes:

1. PHP version: The version of PHP running on the server.
2. Configuration settings: Various settings and directives defined in the PHP configuration file (php.ini).
3. Extensions: A list of loaded PHP extensions and their configurations.
4. Environment variables: Server environment variables and their values.
5. PHP variables: Information about predefined PHP variables, such as `$_SERVER`, `$_GET`, `$_POST`, etc.
6. HTTP headers: HTTP request and response headers.

For a list of all PHP functions enabled on your server, see the tutorial below.

Notes:

  • Use phpinfo() with caution. While it provides valuable information for development and troubleshooting purposes, it should not be left accessible on a production server. After obtaining the necessary information, we recommend removing or commenting out the phpinfo() function call for security purposes.
  • If you only need to know which version of PHP your server is currently running, you can skip the tutorial below and simply go to the Hosting > Overview tab in The Hub.
Check which version of PHP your server is running from The Hub

How to Find Enabled PHP Functions On Your Server Using phpinfo()

By following the steps outlined in this tutorial, you will learn how to easily retrieve a list of information showing all the enabled PHP functions and extensions on your server.

For this tutorial, we’ll show you how to access the list of PHP functions for a WordPress site set up on WPMU DEV hosting. Note that different hosting environments may use different tools and methods to display this information. Reach out to your hosting support if you have any questions or need help.

Step 1: Access your WordPress site’s files

To begin, you need to be able to access the WordPress site’s files stored on your server. You can do this either via FTP or using our File Manager tool.

Step 2: Create a PHP file

Next, create a PHP file using a text editor and add the phpinfo() function shown below:

You can name this PHP file anything you like. In the example below, we’ve named the file ‘info.php’ (note: avoid using an existing filename found on the root folder of your WordPress installation to prevent overwriting the original file).

PHP file
Create a PHP file to call the phpinfo() function.

Save your PHP file and close your text editor.

Step 3: Upload the file to your server

Locate the root directory of your WordPress installation, where the main files like wp-config.php and index.php are located, and upload your file to this folder.

As mentioned earlier, you can do this easily using our File Manager tool.

File Manager
Upload the file to the WordPress install root directory.

Step 4: Access the phpinfo() output

Open your WordPress site in a web browser and enter the URL of the uploaded PHP file to generate a PHP function report.

You should see the PHP information displayed. The output will contain detailed information about the PHP configuration, including all enabled functions on your server.

PHP function report.
PHP function report.

Step 5: Locate the enabled PHP functions

Scroll down the phpinfo() output to find a specific function. Typically, you will find a list of all enabled PHP functions along with their respective settings and configurations in the section labeled “Core.”

That’s all there is to it!

Refer to the Glossary section below if you need to look up any of the functions listed in your generated PHP function report .

Glossary of PHP Functions

This glossary provides a list of various PHP functions and their applications. Feel free to bookmark this page and use it as a quick reference guide to better understand the backend of your WordPress sites.

Configuration

This function deals with setting up PHP to work with the Internet server and to define settings within your PHP scripts.

  • bcmath – This module enables arbitrary precision mathematics in PHP.
  • calendar – This function of PHP allows conversions between various calendar formats.
  • cgi-fcgi – Command for PHP when run in CGI or FastCGI mode.

Core

These are basic PHP functions and classes that form the core of the PHP language.