phpize增加php模块
2015-10-15 22:20
691 查看
一,phpize的好处
什么时候我们要用phpize呢?我们在安装php时:
'./configure' '--prefix=/usr/local/php5' '--with-mysql=/usr/local/mysql' '--with-zlib-dir' '--with-freetype-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--with-gd' '--enable-ftp' '--with-iconv' '--with-gettext' '--with-curl'
'--enable-fastcgi' '--with-openssl'
后面根的参数是我们要的模块,但是随着工作的需要,我们还要在加些模块,又不想重新编译php,这些我们就可以用phpize了。
二,安装php模块
下面我以memcache安装为例子
cd /usr/local/src/memcache-2.2.7 #ext目录下面放的是php的模块库
/usr/local/php/bin/phpize
#确定php-config文件在不在,调用php-config,安装后.so文件会自动放到extension_dir里面
./configure --enable-memcache --with-php-config=/usr/local/php5/bin/php-config
make && make install
安装完后会有这样的东西
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/
三,查看.so文件,以及修改php.ini
cd /usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/
ls -al |grep memcache
-rwxr-xr-x 1 root root 218328 Oct 15 09:36 memcache.so
vi /usr/local/php/lib/php.ini
在加载模块的地加上一行extension=memcache.so
重启服务器或php-fpm
在phpinfo()里查看新增的扩展即可
什么时候我们要用phpize呢?我们在安装php时:
'./configure' '--prefix=/usr/local/php5' '--with-mysql=/usr/local/mysql' '--with-zlib-dir' '--with-freetype-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--with-gd' '--enable-ftp' '--with-iconv' '--with-gettext' '--with-curl'
'--enable-fastcgi' '--with-openssl'
后面根的参数是我们要的模块,但是随着工作的需要,我们还要在加些模块,又不想重新编译php,这些我们就可以用phpize了。
二,安装php模块
下面我以memcache安装为例子
cd /usr/local/src/memcache-2.2.7 #ext目录下面放的是php的模块库
/usr/local/php/bin/phpize
#确定php-config文件在不在,调用php-config,安装后.so文件会自动放到extension_dir里面
./configure --enable-memcache --with-php-config=/usr/local/php5/bin/php-config
make && make install
安装完后会有这样的东西
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/
三,查看.so文件,以及修改php.ini
cd /usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/
ls -al |grep memcache
-rwxr-xr-x 1 root root 218328 Oct 15 09:36 memcache.so
vi /usr/local/php/lib/php.ini
在加载模块的地加上一行extension=memcache.so
重启服务器或php-fpm
在phpinfo()里查看新增的扩展即可
相关文章推荐
- php 不能同时提交form
- Yii2的urlmanager开启
- Yii2的urlmanager开启
- 左右PHP自增力、神秘递减操作
- NTP时间服务器
- 使用 PHP的curl扩展提交 json 格式数据
- 初学者用thinkphp写的一个有文章分享网站
- 解决PHP上传文件中文乱码问题
- vsftp.conf 配置文件详解
- ssh 配置文件讲解大全 ssh调试模式 sftp scp strace进行调试
- TextPicker | 控件文本捕获工具
- PHP利用JPGRAPH画图不显示的解决
- I题 - A+B for Input-Output Practice (VIII)
- H - A+B for Input-Output Practice (VII)
- php获取post中的json数据的实现方法
- G - A+B for Input-Output Practice (VI)
- F题 - A+B for Input-Output Practice (V)
- E题 - A+B for Input-Output Practice (IV)
- PHP文件操作
- php yii多表查询