php添加phpize,已编译PHP情况下,动态添加PHP扩展(phpize)

前些天一朋友在群里问:

编译php时没有加载ftp扩展 ,有什么方法么

已经在使用了

现在已经在跑网站了

编译php时没有加载ftp扩展 ,有什么方法么

能不在重新编译的情况下解决么

现在对方向要ftp 支持图片上传

其实这些可以先baidu或者google的,找不到答案,大部分是不会使用关键词来搜索。

# cd /usr/local/src/php-5.2.13/ext/ftp 进入源码目录的相应扩展模块文件夹

# /usr/local/php-5.2.13/bin/phpize 进入编译好的php相关目录,调用phpize程序生成编译配置文件

# ./configure --with-php-config=/usr/local/php-5.2.13/bin/php-config 注意php-config文件要存在

# make && make install

把生成的复制到php.ini中extension_dir指定的目录

然后php.ini加上extension=ftp.so

# service httpd restart

PHP官方介绍http://php.net/manual/en/install.pecl.phpize.php

附2012/4/10我又通过此方法安装了mcrypt.so

extension_dir=/usr/local/php5.2.13/lib/php/extensions/no-debug-zts-20060613/ (这是自动生成mcrypt.so的目录)

extension=mcrypt.so

Compiling shared PECL extensions with phpize

Sometimes, using the pecl installer is not an option. This could be because you're behind a firewall, or it could be because the extension you want to install is not available as a PECL compatible package, such as unreleased extensions from SVN. If you need to build such an extension, you can use the lower-level build tools to perform the build manually.

The phpize command is used to prepare the build environment for a PHP extension. In the following sample, the sources for an extension are in a directory named extname:

$ cd extname$ phpize$ ./configure$ make# make install

A successful install will have created extname.so and put it into the PHP extensions directory. You'll need to and adjust php.ini and add an extension=extname.so line before you can use the extension.

If the system is missing the phpize command, and precompiled packages (like RPM's) are used, be sure to also install the appropriate devel version of the PHP package as they often include the phpize command along with the appropriate header files to build PHP and its extensions.

Execute phpize --help to display additional usage information.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值