安装程序提示 The fileinfo extension is required.
该怎么修改 PHP.INI 怎么修改后生效啊 军哥 好像在论坛搜到方法了 我试试看 好像还是没操作好 求详细方法 fileinfo默认是没有的需要自己参考 https://www.vpser.net/manage/lnmp-php-install-ext.html 这个照葫芦画瓢 好的 我试试 谢谢军哥 fileinfo 这个参数究竟能不能用 怎么开始的时候 --disable-fileinfo 是怎么回事该模块是一个很挑剔的模块,在1G一下内存的情况下,很容易因为内存过小而造成php无法安装上 1.在 putty 里执行下列命令
cd /root/lnmp1.2-full/src/php-5.5.25/ext/fileinfo/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
2.由于不懂 linux 我用FTP下载 php.ini 这个文件,然后用 editplus 编辑了一下 再上传回去
/usr/local/php/etc/php.ini
找到 ";extension=php_bz2.dll" 这一行
在其上面添加一行:
extension = fileinfo.so
3.最后执行
/etc/init.d/php-fpm restart
[ 本帖最后由 cute2008 于 2015-9-20 12:30 编辑 ] 我的到make && make install执行之后就报错,,,/bin/bash /root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/libtool --mode=compile cc -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/libmagic -I. -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo -DPHP_ATOM_INC -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/include -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/main -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib-DHAVE_CONFIG_H-g -O2 -c /root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/libmagic/apprentice.c -o libmagic/apprentice.lo
cc -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/libmagic -I. -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo -DPHP_ATOM_INC -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/include -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/main -I/root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/lnmp1.2-full/src/php-5.6.9/ext/fileinfo/libmagic/apprentice.c-fPIC -DPIC -o libmagic/.libs/apprentice.o
virtual memory exhausted: Cannot allocate memory
make: *** Error 1
我的是1G内存啊 php5.6.9 ubantu14
回复 9# 的帖子
已经明显的提示你内存不够用了吧其他nginx、mysql等等其他非必须进程都kill掉再编译,不是你有1G就能用1G,也不少1G就一定能安装上
不行就只能加swap或升级内存了
这是什么意思
# make && make install/bin/sh /root/lnmp1.2-full/src/php-5.5.25/ext/fileinfo/libtool --mode=install cp ./fileinfo.la /root/lnmp1.2-full/src/php-5.5.25/ext/fileinfo/modules
cp ./.libs/fileinfo.so /root/lnmp1.2-full/src/php-5.5.25/ext/fileinfo/modules/fileinfo.so
cp ./.libs/fileinfo.lai /root/lnmp1.2-full/src/php-5.5.25/ext/fileinfo/modules/fileinfo.la
PATH="$PATH:/sbin" ldconfig -n /root/lnmp1.2-full/src/php-5.5.25/ext/fileinfo/modules
----------------------------------------------------------------------
Libraries have been installed in:
/root/lnmp1.2-full/src/php-5.5.25/ext/fileinfo/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
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/php/lib/php/extensions/no-debug-non-zts-20121212/
回复 11# 的帖子
编译安装成功,php.ini里再加上就行了
页:
[1]