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.
The Hub - Hosting Overview screen - PHP version information.
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:

<?php
phpinfo();

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.

  • ctype – A library of PHP that checks if the data type of a variable is a valid character type.
  • curl – Used for transferring data with URLs and is the backbone of multiple functions in PHP.
  • date – A group of functions that let you retrieve or format the local or GMT date and time in PHP.
  • dom – A PHP extension that provides a robust, powerful DOM (Document Object Model) XML API.
  • exif – PHP function used to work with image metadata.
  • FFI – Foreign Function Interface is an extension that provides a simple way to call native functions, access native variables, and create/access data structures defined in C libraries.
  • fileinfo – A PHP extension that helps you to identify a file’s mime type.
  • filter – This function filters data by either validating or sanitizing it which aids in securing a PHP application.
  • ftp – FTP PHP functions help establish a connection to a remote FTP server, a crucial part of file sharing.
  • gd – A library used for dynamic image creation.
  • gettext – An extension aimed at the internationalization of PHP scripts by providing translation support.
  • gmp – This is a PHP extension for arbitrary precision mathematics.
  • hash – This function is used to generate a hash value from a string.
  • iconv – Provides an interface to the GNU iconv library, which provides conversion of character sets.
  • igbinary – An alternative to PHP serializer with better performance and smaller size.
  • imagick – A PHP extension that allows working with ImageMagick, a robust software suite to create, edit, and compose images.
  • imap – This function provides an API for talking to the internet mail servers using PHP.
  • intl – This extension helps to perform UCA-conformant collation and date/time/number/currency formatting in PHP.
  • json – JSON functions in PHP allows for encoding and decoding JSON data.
  • ldap – LDAP functions connect, bind and disconnect from an LDAP directory.
  • libxml – A foundation library that offers a set of APIs for manipulating XML, including parsing XML documents and support for other document types like HTML.
  • mbstring – A non-binary string handling extension that provides multibyte specific string functions.
  • mcrypt – Provides a variety of encryption functions.
  • memcache – Memcache module provides handy procedural and object-oriented interface to memcached, high-performance, distributed memory object caching system, generic in nature but intended for use in speeding up dynamic web applications by alleviating database load.
  • memcached – An extension for interfacing with memcached via libmemcached library.
  • msgpack – Provides an interface to msgpack.org, which is a binary-based efficient object serialization library.
  • mysqli – A database driver used to interact with MySQL databases.
  • mysqlnd – It’s the MySQL native driver for PHP.
  • openssl – A robust PHP function used for generating and verifying digital signatures.
  • pcre – Provides functions for ‘perl-compatible regular expressions’.
  • PDO – PHP Data Objects is a database access layer providing a uniform method of access to multiple databases.
  • pdo_mysql – A driver that implements the PHP Data Object (PDO) interface to enable access to MySQL databases.
  • Phar – An archive format combined with a runtime library to help build and load PHP applications bundled into a single file.
  • posix – Accessors to the POSIX (Unix) system calls.
  • readline – Provides an interactive line editing capabilities and history functions.
  • redis – A PHP extension for interfacing with Redis, a high performance key-value storage service.
  • Reflection – A PHP extension, allows inspection and reverse-engineering of PHP programs using a process called “reflection”.
  • session – This function enables user session management.
  • shmop – A simple interface for accessing shared memory segments in PHP.
  • SimpleXML – An extension that simplifies the work of reading XML files.
  • soap – SoapClient is a PHP built-in class providing methods for sending SOAP requests and receiving SOAP responses from a URL.
  • sockets – PHP socket functions let you create and manage network sockets, low-level network communications between servers.
  • sodium – Sodium is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing and more.
  • SPL – The Standard PHP Library (SPL) is a collection of interfaces and classes that are part of PHP core.
  • standard – These are built-in functions and classes provided by PHP which do not rely on external dependencies or PHP extensions.
  • sysvmsg – It provides an interface to System V message queues.
  • sysvsem – Offers access to POSIX-style semaphores.
  • sysvshm – Provides shared memory functions.
  • tokenizer – The tokenizer functions provide an API that allows converting PHP source code into an array of tokens.
  • xml – XML (eXtensible Markup Language) Parser functions let you parse XML documents.
  • xmlreader – An extension that pulls data in and pushes it back out again.
  • xmlrpc – PHP implementation of XML-RPC protocol used in exchanging data across a network.
  • xmlwriter – An extension to create XML documents using a simple ‘constructor-like’ style.
  • xsl – XSL is a language for expressing style sheets to transform XML documents into other XML documents.
  • Zend OPcache – An open-source component that improves PHP performance by storing pre-compiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.
  • zip – PHP zip extension is used to read, write, and manipulate zip archives.
  • zlib – Provides access to zlib compression library.

Additional Modules

These are the underlying software components or libraries that add various functionalities to the PHP scripting language.

Environment

Involved in setting up, configuring, and managing the PHP runtime environment.

PHP Variables

These are used to store data which can be modified during the execution of your script.

DIY or Use Our Support Team

Learning PHP will enhance your ability to troubleshoot, modify and optimize your WordPress site.

Hopefully, this tutorial will come in handy if you need to do a quick look up of your server’s enabled PHP functions. Of course, if your WordPress sites are hosted with WPMU DEV, you can always reach out to our 24/7 support team for expert assistance on anything WordPress and hosting related, or get instant answers with our AI-powered assistant.

And rest assured, our hosting is configured to work with just about all WordPress plugins, applications, and configurations.

This content was originally published here.