PHP添加新模块

来源:互联网 发布:UC数据库设计 编辑:程序博客网 时间:2024/04/30 16:27

一个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.gzcd  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'makemake  install

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

查看安装模块

[root@cyf bin]# ./php  -m[PHP Modules]bcmathCorectypecurldatedomeregfileinfofiltergdgettexthashiconvjsonlibxmlmbstringmcryptmhashmysqlmysqlimysqlndopensslpcntlpcrePDOpdo_mysqlpdo_sqlitePharposixReflectionsessionshmopSimpleXMLsoapsocketsSPLSQLitesqlite3standardsysvsemtokenizerxmlxmlreaderxmlrpcxmlwriterzipzlib[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]# lsconfig.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:         20090626Zend Module Api No:      20090626Zend 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  phproot      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]bcmathCorectypecurldatedomeregfileinfofilterftpgdgettexthashiconvjsonlibxmlmbstringmcryptmhashmysqlmysqlimysqlndopensslpcntlpcrePDOpdo_mysqlpdo_sqlitePharposixReflectionsessionshmopSimpleXMLsoapsocketsSPLSQLitesqlite3standardsysvsemtokenizerxmlxmlreaderxmlrpcxmlwriterzipzlib[Zend Modules]

看PHP已经加入ftp。

0 0
原创粉丝点击