What are PHP extensions and libraries WP needs and/or uses?

  • Codex loosely only mentions PHP version in server requirements, however PHP can be configured in pretty wide range of excluding/including different parts.

    What are extensions/libraries that:

    1. are required for WP to work at all? MySQL...
    2. are required for specific functions? GD ?...
    3. are preferred for best operation of specific functions? cURL...
    4. are commonly used by plugins? Zip...

    Do you aware that there is a SSL error on your site(https://queryposts.com/) ?

    @IamtheMostStupidPerson thank you, automated certificate renewal had failed there for some reason, should be fixed now.

    No worries, It is Let's Encrypt. isn't? I thought it automatically renew... In case if it isn't automatically renew as your case, what can we do?

    @IamtheMostStupidPerson hosting support had reset it (it was set up through their integration), it does normally renew automatically for me.

  • Rarst

    Rarst Correct answer

    9 years ago

    I gave this some more thought and given size of WP code base (including bundled libraries) it doesn't seem very realistic to compile such list by hand (and repeat it for every new version - meh).

    I looked up appropriate static code analysis tool - PHP_CompatInfo and after some tinkering generated following report of extensions used by core (version scanned 3.3.1):

    • cURL - 127 uses (requires libcurl)

      • HTTP API (class WP_Http_curl)
      • url_is_accessable_via_ssl()
      • SimplePie (overridden with class WP_SimplePie_File)
      • GoogleSpell (from TinyMCE package, is not used?)
    • Date/Time - 367 uses

    • DOM - 6 uses (requires libxml)

      • iis7_rewrite_rule_exists()
      • iis7_delete_rewrite_rule()
      • iis7_add_rewrite_rule()
      • saveDomDocument()
    • POSIX Regex - 23 uses

    • Filter - 2 uses

      • class PHPMailer->ValidateAddress() (optional)
    • FTP - 72 uses

      • class ftp_base
      • class ftp (pure and sockets versions)
      • class WP_Filesystem_FTPext
      • class WP_Filesystem_ftpsockets
    • GD - 56 uses

      • wp-admin\includes\image-edit.php
      • wp-admin\includes\image.php
      • wp-includes\media.php
    • Hash - 6 uses

      • wp-includes\pluggable.php multiple uses (optional - fallback in wp-includes\compat.php)
    • iconv - 5 uses

      • class SimplePie (optional)
      • wp_check_invalid_utf8() (optional)
      • wp-mail.php (optional)
    • JSON - 20 uses

      • optional, fallbacks in wp-includes/compat.php
    • libxml - 4 uses

      • class WP_oEmbed->_parse_xml() (optional)
      • SimplePie
    • Multibyte String - 29 uses

      • some fallback in wp-includes/compat.php
    • MySQL - 60 uses

      • class wpdb
      • class SimplePie_Cache (overridden with class WP_Feed_Cache)
    • OpenSSL - 4 uses

      • class PHPMailer
    • PCRE - 743 uses

    • SimpleXML - 1 uses

      • class WP_oEmbed (seems optional)
    • Sockets - 64 uses

      • class ftp (sockets implementation)
    • SPL - 3 uses

    • Tokenizer - 3 uses

      • wp_doc_link_parse() (optional)
    • XML Parser - 89 uses

    • XMLReader - 1 uses

      • SimplePie (seems optional)
    • Zlib - 30 uses

    Great resource. Luckily most of the extensions and libraries above are now compiled by default with PHP 5.2.4 and above.

    @Chris_O as long as default is followed... It's been said several times by core team that there are some weeeeird PHP configurations out there in the wild. What prompted this question from myself is that VPS was purchased at work from new hosting provider and unexpectedly it had very minimal configuration with some typical extensions missing. It would be more convenient to provide support with such check list of extensions, then discover and ask them to be installed one by one.

    Which lib is used to unzip themes and plugins?

    @jgraup ZipArchive or PclZip see related unzip functions http://queryposts.com/?s=unzip_file

    You never cease to amaze me @Rarst ;-)

    With v4.7 and the new native PDF thumbnail/preview your server needs Imagick, ImageMagick, and Ghostscript support.

    Missing **ORACLE** extension and other databases...

    @EASI hm? WordPress has no native support for anything but MySQL.

    it is probably worth mentioning that those libraries **might be used** by core, but it depends on specific configurations and execution paths. for example FTP is unlikely to be used if you use wp-cli to make core and plugin updates.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM