English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Example of Enabling PHP Sockets Extension Support under Linux

Download the source code of the same version of php, compile and install it, and then follow the steps above to generate the so file. Copy it to the rpm installed one, modify php.ini to enable the extension.

Or find the compiled so file of the same version and the same system on the Internet.

Here is a reference method for installing socket extension for PHP under Linux:

#cd /usr/soft/php/ext/sockets (enter the sockets directory under the original php installation file)
#/usr/local/php/bin/phpize (run the phpize under the php installation file after installation)
#./configure --prefix=/usr/local/php/lib --with-php-config=/user/local/php/bin/php-config --enable-sockets
#make
#make install
and modify/usr/local/php/etc/php.ini file
#extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/" (php5.4No need to add the extension path for versions above)

extension=sockets.so

(If you do not want to modify the extension_dir path or there are other .so files in this path, you can also write directly:)

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/sockets.so)

Restart the apache or nginx process, and complete.

This example of enabling socket extension support for PHP under Linux is all the content I share with you. I hope it can provide a reference for you, and I also hope everyone will support and cheer for the tutorial.

You May Also Like