Home > Backend Development > PHP Tutorial > 无需重新编译php加入ftp扩展的解决方法_php技巧

无需重新编译php加入ftp扩展的解决方法_php技巧

WBOY
Release: 2016-05-17 09:06:51
Original
1108 people have browsed it

首先,进入源码目录
cd php-5.2.13/ext/ftp

#运行phpize生成configure
/usr/local/php/bin/phpize

#编译,指定php-config,注意这里的php-config,不是php.ini
./configure --with-php-config=/usr/local/php/bin/php-config
#上面可以添加--enable-ftp,也可以不用添加

#编译安装
make;make install

#生成一个目录来存放扩展的模块
mkdir /usr/local/php/etc/php/ext

#复制ftp.so到模块目录
cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ftp.so /usr/local/php/etc/ext/

#编辑php.ini文件,指定PHP到哪个目录读模块
vi /usr/local/php/etc/php.ini

复制代码 代码如下:

extension_dir="/usr/local/php/etc/ext"
#Load模块
extension=ftp.so

#保存退出

至此,成功完成ftp扩展的加载。

Related labels:
php
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