Home > Backend Development > PHP Problem > How to install socket extension for php

How to install socket extension for php

王林
Release: 2023-03-06 08:24:02
Original
5267 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template