Enable PHP Module For WordPress
WordPress code is created using the PHP programming language. It’s crucial to keep this language updated for both security and functionality as it runs on the server. Although there are many PHP versions that WordPress supports, some of which are even out-of-date, you should generally only use those that have security or stable support. PHP 5.6 is compatible with WordPress. 20 . Since PHP 7.2 is the only version supported, versions earlier than that are not advised.
If you have the most recent version, enter x because it only offers security support. PHP extensions are used by WordPress in many different versions, including some of the outdated PHP core. If the desired extension is absent, WordPress will either need to work harder to complete the task the module assists with or, in the worst case scenario, will remove functionality. Consequently, it is advised to use the PHP extensions listed below.
- curl – Performs remote request operations.
- dom – Used to validate Text Widget content material and to routinely configure IIS7+.
- exif – Works with metadata saved in photos.
- fileinfo – Used to detect mimetype of file uploads.
- hash – Used for hashing, together with passwords and replace packages.
- json – Used for communications with different servers.
- mbstring – Used to correctly deal with UTF8 textual content.
- mysqli – Connects to MySQL for database interactions.
- sodium – Validates Signatures and gives securely random bytes.
- openssl – Permits SSL-based connections to different hosts.
- pcre – Increases efficiency of sample matching in code searches.
- imagick – Provides higher picture high quality for media uploads. See WP_Image_Editor is incoming! for particulars. Smarter picture resizing (for smaller photos) and PDF thumbnail help, when Ghost Script can be obtainable.
- xml – Used for XML parsing, similar to from a third-party website.
- zip – Used for decompressing Plugins, Themes, and WordPress replace packages.
The core PHP programming language can expand its functionality by using extensions, similar to how WordPress can do so by installing plugins. In a folder inside the PHP installation folder, compiled libraries for PHP are installed. There is no default extension folder file or pathname; the extract folder name must be specified in the php.ini configuration file. On Linux-based installations, you can use the command line to search for the directory by typing: php -i | grep extension_dir. On other operating systems, you can look directly in the php . ini configuration file to find the extensions directory.
How Many PHP Extensions Exist?
According to the PHP documentation ref: there are 176 officially documented PHP extensions.
- BC Math
- Direct IO
- Data Structures
- Error Handling
- FastCGI Process Manager
- Function Handling
- IBM DB2
- PHP Options/Info
- Program execution
- Multibyte String
- MySQL (Original)
- Output Control
- Password Hashing
- CUBRID (PDO)
- MS SQL Server (PDO)
- Firebird (PDO)
- IBM (PDO)
- Informix (PDO)
- MySQL (PDO)
- Oracle (PDO)
- ODBC and DB2 (PDO)
- PostgreSQL (PDO)
- SQLite (PDO)
- MS SQL Server (PDO)
- Shared Memory
- Variable handling
- XML Parser
- 0MQ messaging
What PHP Extensions Are Needed For WordPress?
According to the WordPress handbook, WordPress needs:
- 13 official PHP extensions for core performance (pink)
- 9 official PHP extensions for fallback capabilities (orange)
- 3 official PHP extensions if files are non-writable on the server (yellow)
- 1 non-official PHP extension (blue)
What Do These PHP Extensions Do?
Here’s what these core PHP extensions do.
- curl Performs remote request operations.
- dom Used to validate Text Widget content material and to mechanically configure IIS7+.
- exif Works with metadata saved in photos.
- fileinfo Used to detect mime type of file uploads.
- hash Used for hashing, together with passwords and replace packages.
- imagick Provides higher picture high quality for media uploads.
- json Used for communications with different servers.
- mbstring Used to correctly deal with UTF 8 textual content.
- mysqli Connects to MySQL for database interactions.
- openssl Permits SSL-based connections to different hosts.
- pcre Increases efficiency of sample matching in code searches.
- sodium Validates Signatures and offers safe random bytes.
- xml Used for XML parsing, resembling from a third-party web site.
- zip Used for decompressing Plugins, Themes, and WordPress replace packages.
Fallback PHP Extensions
These are fallback PHP extensions, used if the core extensions usually are not carried out – i.e. maybe you’re operating an out-of-date PHP model.
- bcmath For arbitrary precision arithmetic.
- filter Used for securely filtering consumer input.
- gd If Imagick isn’t put in, the GD Graphics Library is used
- iconv Used to transform between character units.
- intl Enable to carry out locale-aware operations.
- mcrypt Generates random bytes when libsodium and /dev/urandom aren’t accessible.
- simplexml Used for XML parsing.
- xmlreader Used for XML parsing.
- zlib Gzip compression and decompression.
PHP Extensions Used For File Changes
These PHP extensions are used when the file system can’t modify a file straight.
- ssh2 Provide entry to remote machine resources (shell, remote exec, file switch)
- ftp Implement shopper entry to files servers talking the File Transfer Protocol (FTP).
- sockets Implements a low-level interface to the socket communication capabilities
Install PHP and PHP extensions
PHP 5.4 (default version on CentOS 6, 7) installation:
Command: sudo yum install php -y PHP extension installation:
Command: sudo yum install php-gd php-mysql -y PHP 5.6 installation:
Command: sudo yum install php56u -y PHP extension installation:
Command: sudo yum install php56u-gd php56u-mysql -y PHP 7.0 installation:
Command: sudo yum install php70u -y PHP extension installation:
Command: sudo yum install php70u-gd php70u-mysqlnd -y PHP 7.1 installation:
Command: sudo yum install php71u -y PHP extension installation:
Command: sudo yum install php71u-gd php71u-mysqlnd -y
2. Restart Apache2 webserver
For changes to take effect, restart your Apache2 webserver. Service restarting can be done with the sudo systemctl command.