List and Management of Built-in PHP Extension Modules (ServBay)
ServBay is a powerful local web development environment that comes preloaded with many commonly used PHP extension modules for each managed PHP version. ServBay provides a convenient graphical user interface (GUI), allowing you to easily enable or disable these built-in extensions without the need to manually edit the php.ini
file. This greatly simplifies the configuration process of your PHP development environment.
How to Manage Built-in PHP Extension Modules in ServBay
With ServBay’s GUI, you can quickly adjust your PHP environment to meet your project's-specific requirements.
Accessing the Extension Management Interface
Follow these steps to open the extension management panel for your desired PHP version:
- Launch the ServBay application.
- In the left navigation panel of the ServBay main window, click Packages.
- In the list of packages on the right, locate and select the PHP version you wish to configure (for example, PHP 8.3).
- Click on that PHP version to expand its detailed configuration area, then switch to the Extension tab.
Overview of Common Built-in Extensions
Under the Extension tab, ServBay lists the manageable extensions built into each PHP version. Below are some common extension modules along with brief descriptions:
- MongoDB: Enables PHP to interact with MongoDB databases.
- OPcache: Significantly improves PHP script execution performance by storing precompiled script bytecode in shared memory. When enabled, you can usually configure parameters such as memory limits and file counts.
- Phalcon: A high-performance, full-stack PHP framework implemented as a C extension.
- Redis: Provides PHP with the ability to communicate with the Redis key-value store system.
- SCWS: A PHP extension for Chinese word segmentation.
- Swoole: A high-performance, asynchronous, event-driven PHP network communication framework.
- Xdebug: A powerful tool for PHP debugging, profiling, and code coverage analysis. When enabled, it typically requires you to configure the debug mode, client port, and other parameters to connect to the debugger.
Please Note: The list of available built-in extensions and the specific configuration options may vary depending on the PHP version you’re using and ServBay updates.
Enabling or Disabling Extensions
Managing extensions in the Extension tab is straightforward:
- Find the extension module you wish to enable or disable.
- There is a toggle switch next to each extension.
- Clicking the switch turns it blue (or filled) to indicate the extension is enabled.
- Clicking the switch turns it gray (or hollow) to indicate the extension is disabled.
Configuring Extension Parameters (If Applicable)
Certain extensions (such as OPcache and Xdebug) display additional configuration options on the right-hand side when enabled.
- You can adjust these settings directly within the ServBay interface—for example, setting OPcache’s shared memory size or configuring Xdebug’s debug port and mode.
Saving Changes and Automatic Application
- After making any changes to extensions or their configuration parameters, be sure to click the Save button in the lower right corner of the interface.
- Important: After you click Save, ServBay will automatically reload or restart the relevant PHP service (usually PHP-FPM or the Apache/Nginx module, depending on your setup) to apply your changes immediately. There’s no need for you to manually stop or start any service.
Verifying Your Changes
Although ServBay applies changes automatically, you can verify whether extensions have been enabled or disabled successfully using the following methods:
- Using the
phpinfo()
function: In the root directory of your website (for instance, within a project folder in/Applications/ServBay/www
), create a simple PHP file containing<?php phpinfo(); ?>
. Access this file in your browser, then search for the extension name you enabled or disabled in the generated page. If the extension is loaded, you’ll see the related configuration information. - Checking from the command line: Open your Terminal application and run the following command to list all modules loaded by the current PHP version (replace the
8.3
in the path with your actual ServBay PHP version):bashCheck the output list for the extension name you changed./Applications/ServBay/package/php/8.3/current/bin/php -m
1
Important Note: Built-in vs. Third-party Extensions
- The Extension tab in ServBay only manages commonly used extensions that come pre-compiled and integrated with ServBay.
- If you need to load third-party PHP extensions (such as a specific version of ionCube Loader or other
.so
files not included with ServBay), you’ll need to follow the instructions in ServBay’s “How to Load Custom PHP Extension Modules” guide. This typically involves manually placing the extension file in the specified directory and manually adding the relevantextension=
orzend_extension=
directive in the Additional Parameters area of the PHP version configuration page. After manual configuration, be sure to click Save, and ServBay will automatically restart services to load these third-party extensions.
Complete List of Built-in PHP Extension Modules in ServBay
ServBay currently includes the following PHP extension modules by default. Actual support and specific versions may vary depending on the ServBay version and the selected PHP version. For the most accurate and up-to-date list of built-in modules for each PHP version, refer to the official ServBay package page.
Below is a list of commonly pre-installed PHP extensions in ServBay:
- apcu
- bcmath
- bz2
- calendar
- Core
- ctype
- curl
- date
- dba
- dom
- exif
- fileinfo
- filter
- ftp
- gd
- gettext
- gmp
- hash
- iconv
- imagick
- imap
- intl
- json
- ldap
- libxml
- mbstring
- memcache
- memcached
- mongodb
- mysqli
- mysqlnd
- openssl
- pcntl
- pcre
- PDO
- pdo_mysql
- pdo_pgsql
- pdo_sqlite
- pgsql
- phalcon
- Phar
- posix
- random
- readline
- redis
- Reflection
- scws
- session
- shmop
- SimpleXML
- soap
- sockets
- sodium
- SPL
- sqlite3
- standard
- swoole
- sysvsem
- sysvshm
- tidy
- tokenizer
- xdebug
- xml
- xmlreader
- xmlwriter
- xsl
- Zend OPcache
- zip
- zlib
With ServBay, you can easily configure the PHP environment your local development projects require, quickly toggle these powerful extensions on or off, and boost efficiency and flexibility in your development workflow.