Find answers to your questions

Documentation

xml2-config error: diagnose PHP build dependencies

The message configure: error: xml2-config not found can appear while preparing to compile PHP from source. It means that this procedure did not find the tool it expected to locate libxml2. By itself, it does not establish that PHP is missing from the server or that an existing website is broken.

Identify the failing procedure

Record the PHP version you are trying to build, operating system, architecture and source or package origin. Identify whether the failure occurs during configuration, compilation or application execution. Keep the original message and preceding lines without translating tool names or options.

A database connection error requires a different investigation: see our MySQL and MariaDB guide. To select the PHP runtime used by your website, start with the PHP version selection guide.

Distinguish legacy builds from the current mechanism

  • PHP before 7.4: the historical procedure looks for xml2-config to locate libxml2. The PHP documentation for this older procedure describes the locations checked. Having the runtime library installed does not establish that the required build components are available.
  • PHP 7.4 and later: libxml configuration uses pkg-config to identify libraries, headers and compiler options. The current PHP procedure explains this mechanism and its search path.

This distinction identifies a build method; it does not recommend an old PHP version. If a recent tool still displays the older message, identify the component or script producing it before adding a package or changing a path.

On hosting managed through a control panel

A shared hosting account should not rebuild PHP to resolve this message. In cPanel, the administrator manages PHP versions and extensions supplied through EasyApache 4, while account options depend on the service. The cPanel PHP documentation explains this arrangement.

LiteSpeed also distinguishes standalone installations from control-panel environments. Its PHP extension guide directs administrators to the relevant panel tools. On a managed service, request a check of the required version and module instead of replacing the installed PHP runtime.

For an administrator-managed source build

The administrator checks dependencies within the actual build environment, including inside a container when applicable. Relevant checks include development headers, a compatible libxml2 version, the detection tool and the paths actually used. PHP’s libxml requirements depend on the target version.

Package names and installation methods depend on the operating system and approved repositories. An installed library may be invisible to the build or incompatible. Guessing a search path, copying a library from another server or disabling libxml just to pass configuration can create another problem. Inspect the configuration log first.

Verify the correction and get help

After a targeted correction, verify dependency detection and application tests in a test environment. A successful build does not establish that the website uses the new binary: web PHP and scheduled-task PHP can differ.

In your client area, provide the context, target version and a sanitized error excerpt without secrets or personal information. Our team can help direct a service correction or plan modernization for an application that depends on an older environment.

Related Articles

Check HTTPS and the LiteSpeed WebAdmin certificate The LiteSpeed WebAdmin certificate protects the connection to the web server’s administration interface. Its configuration is separate from your website, cPanel and WHM. A website can therefore work over HTTPS while the console displays a warning, and installing a website certificate does not automatically correct... An LC.8 Error Appeared If you see an LC.8 error appear while using LiteSpeed, then the IP you have been assigned has been placed on the blacklist due to having a nulled version of LiteSpeed installed. Nulled software is illegal and unsafe and will show up on most search engines. When an IP is found to have a nulled version of LiteSpeed,... How to Change the License Key LiteSpeed makes it very easy to change your license key. Simply type the following into the command terminal: cd /usr/local/lsws/conf mv serial.no serial.no.old mv license.key license.key.old echo "" > serial.no cd ../bin ./lshttpd -r ./lswsctrl restart For help with a Nuagerie service, open or follow up on a... How to Check Your License If you want to check your LiteSpeed license, simply log into the LiteSpeed Web console then go to Actions -> Version Management You should see a section with the following information: Type Serial Expiration Date Software Update UltraVPS serial-key Jun 08, 2018 Jun 08, 2018 For help with a Nuagerie service, open or... Prepare a LiteSpeed installation or migration Replacing a web server affects the sites that depend on it. The procedure must suit your control panel, operating system and selected LiteSpeed edition. Check the environmentIdentify the current web server, panel and supported versions.Confirm the license and integration method available for that...