Home  >  Article  >  Backend Development  >  How to install socket extension for php

How to install socket extension for php

王林
王林Original
2020-09-28 15:18:255007browse

How to install socket extension for php: 1. Execute the [make&make install] command to compile and install; 2. Edit the php.ini configuration file and enable [extension=sockets.so]; 3. Restart apache.

How to install socket extension for php

First compile and install

(Recommended tutorial: php video tutorial)

#cd /home/php5.2.1/ext/sockets
#/server/php/bin/phpize 
#./configure --prefix=/usr/local/php/lib --with-php-config=/server/php/bin/php-config --enable-sockets
#make
#make install

Then modify /usr/local/php/etc/php.ini file

#extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/" (php5.4版本以上不用加扩展路径)
extension=sockets.so

Finally restart apache

Note:

Perform /usr/ in the directory of the PHP module that requires extended compilation local/php/bin/phpize Otherwise, an error will be reported.

Related recommendations: php training

The above is the detailed content of How to install socket extension for php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn