PHP警告:PHP启动:第0行未知中的库(可能不是PHP库)无效

PHP警告:PHP启动:第0行未知中的库(可能不是PHP库)无效,php,php-extension,Php,Php Extension,要将gd-zip扩展添加到php,请完成phpize./configure-make-install例程,仍然找不到gd-zip。有什么想法吗 root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # phpize Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No:

要将gd-zip扩展添加到php,请完成phpize./configure-make-install例程,仍然找不到gd-zip。有什么想法吗

root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # phpize 
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # ./configure 
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for zip archive read/writesupport... yes, shared
checking for the location of libz... no
checking pcre install prefix... no
checking for the location of zlib... /usr
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # make
/bin/bash /root/DOWNLOADS/php-5.5.23/ext/zip/libtool --mode=install cp ./zip.la /root/DOWNLOADS/php-5.5.23/ext/zip/modules
cp ./.libs/zip.so /root/DOWNLOADS/php-5.5.23/ext/zip/modules/zip.so
cp ./.libs/zip.lai /root/DOWNLOADS/php-5.5.23/ext/zip/modules/zip.la
PATH="$PATH:/sbin" ldconfig -n /root/DOWNLOADS/php-5.5.23/ext/zip/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /root/DOWNLOADS/php-5.5.23/ext/zip/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'.

root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # make install
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20121212/
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # 
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # php -m
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'gd.so' in Unknown on line 0

Warning: PHP Startup: Invalid library (maybe not a PHP library) 'gd.so' in Unknown on line 0
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0

Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'zlib.so' in Unknown on line 0

Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zlib.so' in Unknown on line 0
[PHP Modules]
Core
ctype
date
dom
ereg
fileinfo
filter
gd
hash
iconv
json
libxml
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter

[Zend Modules]

root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # 
下面是
进行测试的结果
(跳过所有测试并在顶部打印相同的警告)


不确定是什么原因导致了这一问题,但
清除
然后重新启动phpize&&./configure&&make&&make install解决了这类问题。

问题已经解决,但我想我也遇到了同样的问题

情况是,我将pdo、mysql、mysqli编译为扩展,但它们已经内置(就像原始案例中的zip扩展一样)。我唯一需要做的就是从配置中删除扩展名=pdo.so


在发布php-i之后,它显示了pdo和mysqli支持,但是错误消失了

您正在尝试从源代码编译GD扩展吗?据我所知,如果您使用选项
--with GD
配置PHP,GD从4.3版开始就已经使用PHP编译。很抱歉,GD是zip。请检查PHP.ini中的
扩展目录
部分,并确保zip.so位于正确的目录中(并且
扩展目录
指向正确的目录)。从我看到的
zip.so
文件被放置在
/root/DOWNLOADS/php-5.5.23/ext/zip/modules/
中,看起来有点错误。它没有打印出来,但文件成功地安装到了最终目的地
/usr/local/lib/php/extensions/no-debug-non-zts-20121212
。默认情况下,Php.ini指向该位置,当我将extensions_dir更改为该位置时,它不会更改任何内容。但当我将其更改为其他位置时,错误消息将更改为:
警告:PHP启动:无法加载动态库'/usr/local/lib/PHP/extensions/no-debug-non-zts-20121212/dzadza/zip.so'-/usr/local/lib/PHP/extensions/no-debug-non-zts-20121212/dzadza/zip.so:无法打开共享对象文件:没有这样的文件或目录……
`很好我完全没有主意了。如果你确实找到了答案,那么就发布你的解决方案。我很好奇那里出了什么问题。评论出了令人不快的
。因此
扩展对我也起了作用。
makeclean
拯救我的一天~
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # make test

Build complete.
Don't forget to run 'make test'.

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0
PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0

=====================================================================
PHP         : /usr/local/bin/php 
Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0

PHP_SAPI    : cli
PHP_VERSION : 5.5.23
ZEND_VERSION: 2.5.0
PHP_OS      : Linux - Linux audio-mon 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64
INI actual  : /root/DOWNLOADS/php-5.5.23/ext/zip/tmp-php.ini
More .INIs  :  
CWD         : /root/DOWNLOADS/php-5.5.23/ext/zip
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2015-10-27 09:11:32
=====================================================================
SKIP Check for zip presence [tests/001.phpt] 
SKIP Bug #11216 (::addEmptyDir() crashes when the directory already exists) [tests/bug11216.phpt] 
SKIP Bug #14962 (::extractTo second argument is not really optional) [tests/bug14962.phpt] 
SKIP #38943, properties in extended class cannot be set (5.3+) [tests/bug38943.phpt] 
SKIP Bug #38944 (newly created ZipArchive segfaults when accessing comment property) [tests/bug38944.phpt] 
SKIP Bug #40228 (extractTo does not create recursive empty path) [tests/bug40228.phpt] 
SKIP Bug #47667 (ZipArchive::OVERWRITE seems to have no effect) [tests/bug47667.phpt] 
SKIP Bug #49072 (feof never returns true for damaged file in zip) [tests/bug49072.phpt] 
SKIP Bug #51353 ZIP64 problem, archive with 100000 items [tests/bug51353.phpt] 
SKIP Bug #53579 (stream_get_contents() segfaults on ziparchive streams) [tests/bug53579.phpt] 
SKIP Bug #53603 (ZipArchive should quiet stat errors) [tests/bug53603.phpt] 
SKIP Bug #53854 (Missing constants for compression type) [tests/bug53854.phpt] 
SKIP Bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive) [tests/bug53885.phpt] 
SKIP Bug #64342 ZipArchive::addFile() has to check file existence (variation 1) [tests/bug64342_0.phpt] 
SKIP Bug #64342 ZipArchive::addFile() has to check file existence (variation 2) [tests/bug64342_1.phpt] 
SKIP Bug #7214 (zip_entry_read() binary safe) [tests/bug7214.phpt] 
SKIP Bug #7658 (modify archive with general bit flag 3 set) [tests/bug7658.phpt] 
SKIP Bug #8009 (cannot add again same entry to an archive) [tests/bug8009.phpt] 
SKIP Bug #8700 (getFromIndex(0) fails) [tests/bug8700.phpt] 
SKIP ziparchive::addEmptyDir [tests/oo_addemptydir.phpt] 
SKIP ziparchive::addFile() function [tests/oo_addfile.phpt] 
SKIP zip::close() function [tests/oo_close.phpt] 
SKIP Delete entries [tests/oo_delete.phpt] 
SKIP Extending Zip class and array property [tests/oo_ext_zip.phpt] 
SKIP extractTo [tests/oo_extract.phpt] 
SKIP getComment [tests/oo_getcomment.phpt] 
SKIP getNameIndex [tests/oo_getnameindex.phpt] 
SKIP This test will test getStatusString method in ZipArchive [tests/oo_getstatusstring.phpt] reason: extension not available
SKIP Locate entries by name [tests/oo_namelocate.phpt] 
SKIP zip::open() function [tests/oo_open.phpt] 
SKIP ziparchive::properties isset()/empty() checks [tests/oo_properties.phpt] 
SKIP Rename entries [tests/oo_rename.phpt] 
SKIP setComment [tests/oo_setcomment.phpt] 
SKIP getStream [tests/oo_stream.phpt] 
SKIP Bug #12414 ( extracting files from damaged archives) [tests/pecl12414.phpt] 
SKIP stream_get_meta_data() on zip stream [tests/stream_meta_data.phpt] 
SKIP zip_close() function [tests/zip_close.phpt] 
SKIP zip_entry_compressedsize() function [tests/zip_entry_compressedsize.phpt] 
SKIP zip_entry_compressionmethod() function [tests/zip_entry_compressionmethod.phpt] 
SKIP zip_entry_filesize() function [tests/zip_entry_filesize.phpt] 
SKIP zip_entry_name() function [tests/zip_entry_name.phpt] 
SKIP zip_entry_open() function [tests/zip_entry_open.phpt] 
SKIP zip_entry_read() function [tests/zip_entry_read.phpt] 
SKIP zip_open() function [tests/zip_open.phpt] 
SKIP zip_open() error conditions [tests/zip_open_error.phpt] 
SKIP zip_read() function [tests/zip_read.phpt] 
=====================================================================
TIME END 2015-10-27 09:11:33

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   27
---------------------------------------------------------------------

Number of tests :   46                 0
Tests skipped   :   46 (100.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    1 seconds
=====================================================================