iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers VPS plans with one-click Docker, NVMe storage and a 14-day free trial.
Use docker-php-ext-install in an official PHP image to compile extensions included in that image’s PHP source. A minimal Dockerfile is:
FROM php:8.2-apache
RUN docker-php-ext-install pdo pdo_mysql
Before compiling, check php -m or php -i; many modules are already present. If the extension needs system headers or libraries, install those first, configure optional features when required, then compile and verify the resulting image.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →What docker-php-ext-install does
docker-php-ext-install is a helper script shipped with the official PHP Docker images. It builds extensions available in the PHP source bundled with the selected image tag. The same images also provide docker-php-ext-configure for custom configure arguments and docker-php-ext-enable for turning on an installed shared module.
The helper is not a general package manager. It does not automatically discover or install the operating-system development files an extension needs, and it is not the documented route for every extension distributed outside PHP’s bundled source. Those distinctions determine which command and which prerequisite packages belong in your Dockerfile.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
Choose the image before writing the command
Start with an official PHP image tag that matches the way your application runs. The common variants are:
clifor command-line workloads and workers.apachewhen PHP runs through the Apache web server included in the image.fpmwhen PHP-FPM is paired with a separate web server or proxy.
The PHP version, image variant and base distribution affect which extensions are available, which package manager you use, the names of development libraries, and the configure flags accepted by an extension. Treat examples as patterns tied to their stated tag, not as universal copy-and-paste instructions.
Check whether the module is already installed
Run the check in the image you intend to build from:
docker run --rm php:8.2-cli php -m
Search the output for the module name. For detailed build and configuration information, use:
docker run --rm php:8.2-cli php -i
If the extension is already compiled into the image, adding another build step only increases build time and can introduce unnecessary dependencies. This check is especially important because the official images include a number of commonly used modules in advance.
The repeatable installation workflow
For a module that is part of the bundled PHP source, use this sequence:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
- Select the runtime image. Pin an official tag such as
php:8.2-apache,php:8.2-fpmorphp:8.2-cliaccording to your deployment. - Inspect the existing module list. Use
php -morphp -ibefore compiling. - Install development dependencies. Add the headers and libraries required by the extension with the package manager belonging to the image’s base distribution. The helper script expects these files to be present.
- Configure optional features. Run
docker-php-ext-configurewhen the extension needs non-default flags, such as enabling image formats in GD. - Compile the extension. Invoke
docker-php-ext-installwith one or more extension names. Add parallel jobs when the builder has enough CPU and memory. - Clean the build layer. Remove apt package lists in the same layer as the installation, and plan how build-only files will stay out of a production runtime image.
- Verify the result. Re-run
php -morphp -iin the built image and confirm the expected module and feature settings.
Keeping the related commands in one RUN instruction makes cleanup effective and prevents package indexes from remaining in an earlier image layer.
Example: PDO and MySQL support
For extensions available without special feature flags, the Dockerfile can be as small as:
FROM php:8.2-apache
RUN docker-php-ext-install pdo pdo_mysql
pdo supplies PHP’s database abstraction layer and pdo_mysql supplies the MySQL driver. The image tag is part of the example: choose the PHP version and server variant that your application actually uses. If either module already appears in php -m, omit it from the build command.
Example: GD with FreeType, JPEG and PNG
GD demonstrates the full dependency, configuration and compilation sequence. The documented Debian-based pattern for the PHP-FPM 8.2 image is:
Free tools Windows power users keep installed
One-click scans. No signup required.
FROM php:8.2-fpm
RUN apt-get update && apt-get install -y
libfreetype-dev
libjpeg62-turbo-dev
libpng-dev
&& rm -rf /var/lib/apt/lists/*
&& docker-php-ext-configure gd --with-freetype --with-jpeg
&& docker-php-ext-install -j$(nproc) gd
Each part has a specific role:
apt-get updaterefreshes the package index used by the Debian-based image.libfreetype-dev,libjpeg62-turbo-devandlibpng-devprovide development files required for the selected GD features.rm -rf /var/lib/apt/lists/*removes the package lists in the same layer.docker-php-ext-configure gd --with-freetype --with-jpegrequests FreeType and JPEG support before compilation. PNG support is supplied by the installed PNG development package.docker-php-ext-install -j$(nproc) gdbuilds GD using the available processor count.
Package names and accepted flags vary with the PHP tag and whether the image is Debian- or Alpine-based. Confirm the requirements for your exact tag rather than assuming this Debian example applies unchanged elsewhere.
Configure, install and enable are different operations
| Helper or command | Purpose | Use it when |
|---|---|---|
docker-php-ext-configure |
Passes custom configure arguments before compilation. | An extension needs optional features or non-default build flags, such as GD’s FreeType and JPEG options. |
docker-php-ext-install |
Compiles extensions available in the PHP source bundled by the official image. | The module is a bundled PHP extension and its development dependencies are installed. |
docker-php-ext-enable |
Enables an installed shared module. | A module has already been built as a shared extension, including one installed through PECL. |
pecl install <extension> |
Downloads and builds an extension distributed through PECL. | The extension is not part of the bundled core source accepted by docker-php-ext-install. |
Do not add docker-php-ext-configure simply because it appears in an example. Use it when the extension’s build requires a flag. Conversely, running docker-php-ext-enable does not compile anything; it only activates a module that is already installed.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
When PECL is the correct path
Some popular PHP extensions are distributed through PECL rather than the core source in the official image. The documented pattern is:
RUN pecl install <extension>
&& docker-php-ext-enable <extension>
Replace <extension> with the PECL package name required by the module’s documentation. Do not assume that a name accepted by PECL is also accepted by docker-php-ext-install, or that an extension with a familiar PHP name is part of the bundled source. First classify the module as core, PECL, or another documented installer, then use the matching workflow.
Recommended Free Tools
Debian and Alpine images require different preparation
The helper scripts have the same names, but the operating-system preparation is not interchangeable. A Debian-based tag uses Debian package tooling and package names; an Alpine-based tag uses Alpine tooling and its own package names. The development headers, available module versions and configure flags can differ as well.
Before writing an installation line, identify the base family documented for your exact PHP tag. Then:
- Use the package manager and development package names for that base.
- Check that the extension exists for the selected PHP version.
- Apply configure flags supported by that version of the extension.
- Keep the package installation, compilation and cleanup in a coherent build layer.
Copying an apt-get example into an Alpine image, or copying Alpine package names into a Debian image, fails before the PHP helper can do any work.
Control build time with parallel compilation
The helper accepts make options, so a build can use multiple jobs:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsRank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
RUN docker-php-ext-install -j$(nproc) pdo pdo_mysql
$(nproc) asks the container for the available processor count. Parallel compilation can shorten builds, but it also consumes more memory and CPU. Use it when the builder has sufficient resources; reduce the job count or omit the option when constrained environments become unstable. The extension list and all required libraries remain the same regardless of the job count.
Keep the resulting image maintainable
Clean package indexes in the same layer
For Debian-based images, remove /var/lib/apt/lists/* in the same RUN instruction that performs apt-get update and installs the development packages. Cleaning in a later layer does not remove the bytes stored in the earlier layer.
Separate build-only material from runtime material
Compilers, headers and other development files are needed to build an extension but are not necessarily needed to run PHP. When designing a production image, avoid carrying build-only files into the runtime image. A multi-stage build or an explicit removal strategy can provide that separation; choose the approach that matches the extension and your deployment process.
Do not leave extracted PHP source behind
If you manually run docker-php-source extract, delete the extracted source in the same image layer after compilation. The configure and install helpers normally manage source extraction for their documented use cases, so manual extraction is usually unnecessary.
Verify the module after the image builds
Build the Dockerfile, start a container from the resulting image and inspect the module list:
docker build -t php-extension-test .
docker run --rm php-extension-test php -m
For feature-specific checks, inspect the detailed configuration:
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
docker run --rm php-extension-test php -i
For GD, the detailed output lets you confirm that the configured image capabilities are present. For database support, look for both the PDO base module and the driver you installed. Performing the check against the final image catches mistakes caused by building one tag and running another.
Troubleshoot failures in the order they occur
The command says the extension is unavailable
First compare the requested name with the modules available in the selected PHP tag. docker-php-ext-install only handles extensions present in the bundled PHP source. If the module is distributed through PECL, use the PECL installation followed by docker-php-ext-enable. If it is already listed by php -m, remove the redundant build step.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11The build cannot find a header or library
This indicates a missing operating-system development dependency. Add the required headers and libraries before the helper command, using package names for the image’s Debian or Alpine base. A runtime library alone is not enough when compilation requires development files.
Optional functionality is missing
Installing a library does not automatically pass its feature flag to the extension’s configure step. Add docker-php-ext-configure with the documented options for the extension, then run docker-php-ext-install. The GD example explicitly configures FreeType and JPEG before compiling.
apt-get cannot locate a package
Check the image family and PHP tag before changing the package name. Debian package names do not apply to Alpine, and a package available for one distribution release may not be available for another. Use the dependency names documented for the exact base image rather than substituting a similarly named runtime package.
The image becomes unexpectedly large
Review whether package indexes, compilers, headers or extracted source remain in the final image. Keep apt-list cleanup beside the installation command and use a production build design that excludes build-only files from the runtime stage.
Compilation exhausts resources
Parallel jobs multiply compiler resource use. Remove -j$(nproc) or select a smaller job count when the builder has limited memory or CPU, then retry with the same dependencies and extension configuration.
The module built but is not active
Determine whether the result is a shared module that needs activation. docker-php-ext-enable enables an installed shared extension, including one obtained through PECL. It is separate from both compiling with docker-php-ext-install and configuring with docker-php-ext-configure.
Quick Recap
A practical decision guide
| Situation | Next action |
|---|---|
The module appears in php -m. |
Use the existing module; do not compile it again. |
| The module is part of the bundled PHP source and needs no special flags. | Install its system development dependencies, then run docker-php-ext-install. |
| The bundled module needs optional capabilities. | Install the corresponding libraries, run docker-php-ext-configure, then compile it. |
| The extension is distributed through PECL. | Run pecl install and then docker-php-ext-enable. |
| The Dockerfile uses a different base distribution from the example. | Translate the dependency and cleanup steps to that distribution before invoking the PHP helper. |
| The build is slow but the builder has ample resources. | Use parallel jobs such as -j$(nproc). |
| The final image contains development clutter. | Clean package indexes in the installation layer and separate build-only files from the runtime image. |
Common Dockerfile mistakes to avoid
- Compiling before checking. A module already present in the image does not need another installation step.
- Omitting development packages. The helper scripts do not install extension dependencies for you.
- Using the wrong helper. Core extensions, PECL extensions and already-installed shared modules follow different paths.
- Skipping required configure flags. Libraries such as FreeType and JPEG must be selected through the extension’s configure options when the build requires them.
- Mixing distributions. Package commands and names must match the image’s base family.
- Cleaning in a later layer. Remove apt lists in the same layer that created them.
- Leaving manual source extraction behind. Delete extracted source in the same layer, or let the documented helpers manage it.
- Building with unlimited parallelism on a small runner. Adjust the job count to the resources available to the build.
Final pre-build checklist
- The image tag matches the application’s PHP version and runtime variant.
php -morphp -iconfirms the module is not already present.- The module is classified correctly as bundled core, PECL, or another installer path.
- Development headers and libraries are installed before compilation.
- Required configure flags are listed before
docker-php-ext-install. - The package manager and package names match the image’s Debian or Alpine base.
- Parallel jobs are appropriate for the builder’s CPU and memory.
- Package indexes and any manually extracted source are removed in the same layer.
- The finished image is tested with
php -mand, when necessary,php -i.
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.

