PHP添加新模块

一个PHP项目需要添加ftp的模块,需要添加。 解决备注:
1
centos 6.5
PHP 5.3.28
iptable selinux 全部关闭

2
PHP简单安装

yum install -y libxml2 libxml2-devel libcurl libcurl-devel gd gd-devel
tar -zxvf php-5.3.28.tar.gz
cd  php-5.3.28
'./configure'  '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv=/usr/local' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-safe-mode' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--with-curlwrappers' '--enable-mbregex' '--enable-fpm' '--enable-mbstring' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--with-gettext' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-zip' '--enable-soap'
make
make  install

这里面有一个技巧:make -j4 表示4个处理器一起进行编译 这样速度会快很多。

查看安装模块

[root@cyf bin]# ./php  -m
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
ereg
fileinfo
filter
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
SQLite
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib

[Zend Modules]

没有ftp的模块

添加模块:


[root@cyf bin]# find /root/php-5.3.28   -name  ftp
/root/php-5.3.28/ext/ftp
[root@cyf ftp]# cd /root/php-5.3.28/ext/ftp/
[root@cyf ftp]# ls
config.m4  config.w32  CREDITS  ftp.c  ftp.h  package.xml  php_ftp.c  php_ftp.h  tests
[root@cyf ftp]# /usr/local/php/bin/phpize 
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
[root@cyf ftp]# ./configure --with-php-config=/usr/local/php/bin/php-config 
[root@cyf ftp]# make  &&  make install
[root@cyf php-5.3.28]# cp  php.ini-development   /usr/local/php/etc/php-ini
[root@cyf php-5.3.28]# pwd
/root/php-5.3.28
[root@cyf ~]# extension=ftp.so  >> /usr/local/php/etc/php—ini
[root@cyf php]# pkill php
[root@cyf php]# ps -ef | grep  php
root      44786   1689  0 13:25 pts/0    00:00:00 grep php
[root@cyf php]# cd  sbin
[root@cyf sbin]# ./php-fpm 
[root@cyf sbin]# 
[root@cyf sbin]# /usr/local/php/bin/php  -m
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
SQLite
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib

[Zend Modules]


看PHP已经加入ftp。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值