php编译扩展

今天在php程序中要使用exif信息,发现服务器的php居然没有编译这个模块,网上找了个教程,在这里做个笔记,省得以后忘了。

cd [php-source-dir]/ext/exif/
export PHP_PREFIX=”[your php install full path]”
$PHP_PREFIX/bin/phpize
./configure –enable-exif=shared –with-php-config=$PHP_PREFIX/bin/php-config
make
make install

配置php.ini
extension=”…/exif.so”
或者设置extension_dir = “[so-path]” , extension=”exif.so”

重起nginx

Leave a Reply

Your email address will not be published. Required fields are marked *

*