To install a PHP extension from source, compile it with the development tools for the exact PHP installation that will load it, install the resulting module, enable it in that runtime’s configuration, and reload the relevant service. For a typical shared extension, the PHP manual’s basic build sequence is phpize, ./configure, make, and make install. The details vary by extension, operating system, PHP build, and runtime, so first confirm that your build tools and target PHP match.
Before compiling: decide whether source is the right route
First check whether your operating system provides a compatible package for the PHP version you use. Distribution packages can simplify updates and version matching; PHP documents distribution-specific installation routes in its installation index. If a maintained package does not fit, check whether the extension and your environment are supported by PIE (PHP Installer for Extensions). The PHP manual now marks PECL deprecated and recommends PIE in its place.
Build from source when you need a manual build, such as when no compatible package or supported installer route is available. These options are not universally interchangeable: check extension availability, PHP compatibility, and deployment requirements before choosing.
Match the build tools to the PHP installation
PHP extensions must be built for the PHP installation that will load them. This matters especially on machines with multiple PHP versions, separate CLI and web-server installations, or custom PHP builds. PHP’s php-config documentation explains that the utility reports the PHP version, include paths, extension directory, and configuration options.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Identify the PHP binary used by the intended runtime.
- Locate the matching
phpizeandphp-config. - Check the target PHP version, headers, and extension directory with that
php-config. - Use the matching PHP development package on package-managed systems. PHP notes that development packages often include
phpizeand the headers needed to build extensions.
There is no reliable universal package-install command: package names and dependencies vary by operating system and PHP distribution. Consult the extension’s build instructions for required external libraries and development headers. PHP’s PECL introduction also advises using known-good build tools such as autoconf, automake, and libtool.
Compile a shared extension with phpize
For an extension whose source directory contains the PHP extension build files, the PHP manual documents this basic workflow:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
- Open the extension source directory:
cd extname. Replaceextnamewith the actual directory name. - Prepare the build environment:
phpize. The PHP manual describesphpizeas the command that prepares an extension’s build environment. - Configure the build:
./configure. Add options required by the extension. If multiple PHP installations are present, select the target PHP explicitly, for example:./configure --with-php-config=/path/to/the/target/php-config. - Compile:
make. - Install:
make install. A successful build produces a shared module—often named something likeextname.so—and installs it in the extension directory associated with the selected PHP build.
The sequence is a starting point, not a guarantee that every extension builds without additional options. Follow the extension’s own instructions for configure switches and external libraries. Do not substitute a different version’s phpize or php-config just because those commands are available first in your shell’s PATH.
Enable the extension in the intended PHP runtime
Installing the module does not automatically make every PHP process load it. Add an extension directive, such as extension=extname.so, to the configuration read by the PHP SAPI you want to use. CLI PHP and a web server or PHP process manager may use different binaries and configuration files, so verify the target runtime rather than assuming they share settings.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
After enabling it, restart or reload the relevant web service or PHP process manager so it rereads its configuration. PHP’s extension installation guidance says a service restart is required after enabling an extension.
Verify the loaded module and troubleshoot common failures
Check the configuration and loaded modules in the same runtime that needs the extension. A successful compiler exit or make install alone does not prove that PHP can load the module.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
phpizeis missing: On a package-managed system, the matching PHP development package may not be installed. Confirm that it belongs to the target PHP version.- The module is installed but not loaded: Check that the extension directive is in the configuration used by the intended SAPI, then restart or reload the relevant service.
- The build uses the wrong PHP: Re-run configuration with the target installation’s
php-configpath, and confirm that its PHP version, include paths, and extension directory match the runtime. - Configuration or compilation fails: Check the extension’s required libraries, development headers, and configure options. These requirements are extension- and system-specific.
If the extension’s own build instructions provide cleanup commands, follow them. For example, the PHP manual’s installation example for ds uses make clean and phpize --clean; treat that as an example, not a universal cleanup procedure or current dependency guide.
When a static build makes sense
Most readers looking to add one extension should consider the shared-extension route first. A static build is a different approach: the PHP manual’s static build instructions describe placing extension source in the PHP source tree, regenerating build configuration with buildconf, checking available options with ./configure --help, and rebuilding PHP. Whether an extension uses a --with- or --enable- option depends on that extension. Check the current build documentation for the target PHP source before using version-specific build-tool requirements from older instructions.
Recommended Free Tools
Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

