PHP Extension Module List and Usage (Built-in ServBay)
ServBay comes pre-installed with many commonly used PHP extensions for each PHP version it manages, providing a convenient graphical interface to enable or disable them. This allows you to quickly configure these popular extensions without manually editing the php.ini
file.
How to Enable Built-in PHP Extension Modules in ServBay
Accessing the Extension Management Interface
- Open the ServBay application.
- In the left navigation bar, click on Languages.
- From the list on the right, select the PHP version you wish to configure (for example, PHP 8.3).
- In the expanded service configuration area of that PHP version, click on the Extension tab (as indicated by the arrow in the image below).
Common Built-in Extensions
Under the Extension tab, you will see a list of manageable extensions. Common extension modules include:
- MongoDB: An extension for interacting with MongoDB databases.
- OPcache: Enhances PHP performance by storing precompiled script bytecode in shared memory. Enabling it usually presents additional configuration options (such as memory consumption, maximum file count, etc.).
- Phalcon: A full-stack PHP framework delivered as a C extension.
- Redis: An extension for interacting with Redis key-value stores.
- SCWS: A simple Chinese word segmentation system extension.
- Swoole: A high-performance network communication framework based on coroutines.
- Xdebug: A powerful PHP debugging and performance analysis tool. Enabling it typically reveals additional configuration options (such as debugging mode, client port, etc.).
Note: The list of available extensions and specific configuration items may vary slightly depending on the PHP version you are using and updates from ServBay.
How to Enable or Disable Extensions
- In the Extension tab, find the extension you want to enable or disable.
- Next to each extension is a Toggle Switch.
- Click the switch to turn it blue (or filled state) to indicate that the extension is enabled.
- Click the switch to turn it gray (or hollow state) to indicate that the extension is disabled.
Configuring Extension Parameters (if applicable)
- For certain extensions (like OPcache, Xdebug), additional configuration options will be displayed on the right when you enable them.
- You can adjust these parameters as needed (for example, setting the memory size for OPcache, configuring the mode and port for Xdebug).
Save Changes and Automatically Restart Services
- After enabling/disabling extensions or modifying their parameters, be sure to click the Save button at the bottom right of the interface.
- Important: Once you click Save, ServBay will automatically reload or restart the corresponding PHP service to apply your changes. You do not need to manually stop and start the service.
Verify Changes
Although the services automatically restart, you can still verify whether the extensions have been successfully enabled or disabled by:
- Using
phpinfo()
: Create a PHP file containing<?php phpinfo(); ?>
, access it through the web server, and check the output page for the names of the extensions you enabled/disabled. - Using the command line: Open a terminal and execute the command (replace the version number in the path with your actual configured version):bashThis command will list all the loaded PHP modules. Check the list to see if the extension you changed is included (or no longer included).
/Applications/ServBay/package/php/8.3/current/bin/php -m
1
Important Notes
- This Extension tab manages the commonly used extensions that are precompiled and integrated by ServBay.
- If you need to load third-party extensions (such as ionCube Loader or other
.so
files not listed here), you would need to follow the steps in the “How to Load Third-Party PHP Extensions” document to manually place the files and addextension=
orzend_extension=
directives under Additional Parameters in the PHP tab for configuration. After saving this configuration, ServBay will also automatically restart the service.
Extension Module List
ServBay currently has the following built-in PHP extension modules, with actual support depending on the version. For the latest module list for each version, please visit PHP Versions and Modules.
- 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