anonymous66

anonymous66 查看完整档案

福州编辑福建船政交通职业学院  |  计算机应用技术 编辑飞鱼科技  |  WEB程序 编辑 shenmeguifk.sinaapp.com/index.php?s=/Facebook/content 编辑
编辑

个人动态

anonymous66 关注了问题 · 2020-02-12

php 安装拓展 zip 包问题

我是自己打包,问题出在 make 步骤。

/bin/sh /Users/edison/zip-1.8.10/libtool --mode=compile cc \-I. -I/Users/edison/zip-1.8.10 -DPHP\_ATOM\_INC -I/Users/edison/zip-1.8.10/include -I/Users/edison/zip-1.8.10/main -I/Users/edison/zip-1.8.10 -I/usr/local/Cellar/php56/5.6.18/include/php -I/usr/local/Cellar/php56/5.6.18/include/php/main -I/usr/local/Cellar/php56/5.6.18/include/php/TSRM -I/usr/local/Cellar/php56/5.6.18/include/php/Zend -I/usr/local/Cellar/php56/5.6.18/include/php/ext -I/usr/local/Cellar/php56/5.6.18/include/php/ext/date/lib -I/usr/local/include \-DHAVE\_CONFIG\_H \-g -O2  \-c /Users/edison/zip-1.8.10/php\_zip.c -o php\_zip.lo

cc -I. -I/Users/edison/zip-1.8.10 -DPHP\_ATOM\_INC -I/Users/edison/zip-1.8.10/include -I/Users/edison/zip-1.8.10/main -I/Users/edison/zip-1.8.10 -I/usr/local/Cellar/php56/5.6.18/include/php -I/usr/local/Cellar/php56/5.6.18/include/php/main -I/usr/local/Cellar/php56/5.6.18/include/php/TSRM -I/usr/local/Cellar/php56/5.6.18/include/php/Zend -I/usr/local/Cellar/php56/5.6.18/include/php/ext -I/usr/local/Cellar/php56/5.6.18/include/php/ext/date/lib -I/usr/local/include -DHAVE\_CONFIG\_H -g -O2 -c /Users/edison/zip-1.8.10/php\_zip.c \-fno-common -DPIC -o .libs/php\_zip.o

In file included from /Users/edison/zip-1.8.10/php\_zip.c:30:

./php\_zip.h:47:9: warning: 'OPENBASEDIR\_CHECKPATH' macro redefined \[-Wmacro-redefined\]

#define OPENBASEDIR\_CHECKPATH(filename) \\

 ^

/usr/local/Cellar/php56/5.6.18/include/php/main/fopen\_wrappers.h:42:9: note: previous definition is here

#define OPENBASEDIR\_CHECKPATH(filename) \\

 ^

In file included from /Users/edison/zip-1.8.10/php\_zip.c:32:

./lib/zipint.h:52:9: warning: 'MAXCOMLEN' macro redefined \[-Wmacro-redefined\]

#define MAXCOMLEN 65536

 ^

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h:95:9: note: previous definition

 is here

#define MAXCOMLEN  16 /\* max command name remembered \*/

 ^

/Users/edison/zip-1.8.10/php\_zip.c:113:57: warning: incompatible pointer types passing 'unsigned int \*' to parameter of type 'size\_t \*'

 (aka 'unsigned long \*') \[-Wincompatible-pointer-types\]

 php\_basename(file, file\_len, NULL, 0, &file\_basename, (unsigned int \*)&file\_basename\_len TSRMLS\_CC);

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/ext/standard/php\_string.h:128:105: note: passing argument to parameter 'p\_len' here

PHPAPI void php\_basename(const char \*s, size\_t len, char \*suffix, size\_t sufflen, char \*\*p\_ret, size\_t \*p\_len TSRMLS\_DC);

 ^

/Users/edison/zip-1.8.10/php\_zip.c:115:7: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(file\_dirname\_fullpath)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:115:7: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:115:7: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:164:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(fullpath)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:164:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:164:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:409:66: error: too few arguments to function call, expected 4, have 2

 retval = std\_hnd->get\_property\_ptr\_ptr(object, member TSRMLS\_CC);

 \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^

/Users/edison/zip-1.8.10/php\_zip.c:446:12: error: no member named 'refcount' in 'struct \_zval\_struct'

 retval->refcount = 0;

 \~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:452:65: error: too few arguments to function call, expected 4, have 3

 retval = std\_hnd->read\_property(object, member, type TSRMLS\_CC);

 \~~~~~~~~~~~~~~~~~~~~~~  ^

/Users/edison/zip-1.8.10/php\_zip.c:564:53: error: no member named 'default\_properties' in 'struct \_zend\_class\_entry'

 zend\_hash\_copy(intern->zo.properties, &class\_type->default\_properties, (copy\_ctor\_func\_t) zval\_add\_ref,

 \~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:664:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(filename)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:664:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:664:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:952:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(filename)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:952:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:952:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:1077:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(filename)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:1077:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:1077:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:1969:43: warning: incompatible pointer types assigning to 'zend\_object\_get\_property\_ptr\_ptr\_t' (aka 'struct

 \_zval\_struct \*\*(\*)(struct \_zval\_struct \*, struct \_zval\_struct \*, int, const struct \_zend\_literal \*)') from 'zval \*\*(zval \*, zval \*)' (aka 'struct

 \_zval\_struct \*\*(struct \_zval\_struct \*, struct \_zval\_struct \*)') \[-Wincompatible-pointer-types\]

 zip\_object\_handlers.get\_property\_ptr\_ptr = php\_zip\_get\_property\_ptr\_ptr;

 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/edison/zip-1.8.10/php\_zip.c:1972:36: warning: incompatible pointer types assigning to 'zend\_object\_read\_property\_t' (aka 'struct \_zval\_struct

 \*(\*)(struct \_zval\_struct \*, struct \_zval\_struct \*, int, const struct \_zend\_literal \*)') from 'zval \*(zval \*, zval \*, int)' (aka 'struct

 \_zval\_struct \*(struct \_zval\_struct \*, struct \_zval\_struct \*, int)') \[-Wincompatible-pointer-types\]

 zip\_object\_handlers.read\_property  \= php\_zip\_read\_property;

 ^ ~~~~~~~~~~~~~~~~~~~~~

10 warnings and 14 errors generated.

make: \*\*\* \[php\_zip.lo\] Error 1

提示如上,求帮助!
我是要打包一个 php_zip.io

关注 0 回答 1

anonymous66 回答了问题 · 2020-02-12

php 安装拓展 zip 包问题

image.pngimage.pngimage.png

截图在此

关注 0 回答 1

anonymous66 提出了问题 · 2020-02-12

php 安装拓展 zip 包问题

我是自己打包,问题出在 make 步骤。

/bin/sh /Users/edison/zip-1.8.10/libtool --mode=compile cc \-I. -I/Users/edison/zip-1.8.10 -DPHP\_ATOM\_INC -I/Users/edison/zip-1.8.10/include -I/Users/edison/zip-1.8.10/main -I/Users/edison/zip-1.8.10 -I/usr/local/Cellar/php56/5.6.18/include/php -I/usr/local/Cellar/php56/5.6.18/include/php/main -I/usr/local/Cellar/php56/5.6.18/include/php/TSRM -I/usr/local/Cellar/php56/5.6.18/include/php/Zend -I/usr/local/Cellar/php56/5.6.18/include/php/ext -I/usr/local/Cellar/php56/5.6.18/include/php/ext/date/lib -I/usr/local/include \-DHAVE\_CONFIG\_H \-g -O2  \-c /Users/edison/zip-1.8.10/php\_zip.c -o php\_zip.lo

cc -I. -I/Users/edison/zip-1.8.10 -DPHP\_ATOM\_INC -I/Users/edison/zip-1.8.10/include -I/Users/edison/zip-1.8.10/main -I/Users/edison/zip-1.8.10 -I/usr/local/Cellar/php56/5.6.18/include/php -I/usr/local/Cellar/php56/5.6.18/include/php/main -I/usr/local/Cellar/php56/5.6.18/include/php/TSRM -I/usr/local/Cellar/php56/5.6.18/include/php/Zend -I/usr/local/Cellar/php56/5.6.18/include/php/ext -I/usr/local/Cellar/php56/5.6.18/include/php/ext/date/lib -I/usr/local/include -DHAVE\_CONFIG\_H -g -O2 -c /Users/edison/zip-1.8.10/php\_zip.c \-fno-common -DPIC -o .libs/php\_zip.o

In file included from /Users/edison/zip-1.8.10/php\_zip.c:30:

./php\_zip.h:47:9: warning: 'OPENBASEDIR\_CHECKPATH' macro redefined \[-Wmacro-redefined\]

#define OPENBASEDIR\_CHECKPATH(filename) \\

 ^

/usr/local/Cellar/php56/5.6.18/include/php/main/fopen\_wrappers.h:42:9: note: previous definition is here

#define OPENBASEDIR\_CHECKPATH(filename) \\

 ^

In file included from /Users/edison/zip-1.8.10/php\_zip.c:32:

./lib/zipint.h:52:9: warning: 'MAXCOMLEN' macro redefined \[-Wmacro-redefined\]

#define MAXCOMLEN 65536

 ^

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h:95:9: note: previous definition

 is here

#define MAXCOMLEN  16 /\* max command name remembered \*/

 ^

/Users/edison/zip-1.8.10/php\_zip.c:113:57: warning: incompatible pointer types passing 'unsigned int \*' to parameter of type 'size\_t \*'

 (aka 'unsigned long \*') \[-Wincompatible-pointer-types\]

 php\_basename(file, file\_len, NULL, 0, &file\_basename, (unsigned int \*)&file\_basename\_len TSRMLS\_CC);

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/ext/standard/php\_string.h:128:105: note: passing argument to parameter 'p\_len' here

PHPAPI void php\_basename(const char \*s, size\_t len, char \*suffix, size\_t sufflen, char \*\*p\_ret, size\_t \*p\_len TSRMLS\_DC);

 ^

/Users/edison/zip-1.8.10/php\_zip.c:115:7: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(file\_dirname\_fullpath)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:115:7: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:115:7: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:164:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(fullpath)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:164:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:164:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:409:66: error: too few arguments to function call, expected 4, have 2

 retval = std\_hnd->get\_property\_ptr\_ptr(object, member TSRMLS\_CC);

 \~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^

/Users/edison/zip-1.8.10/php\_zip.c:446:12: error: no member named 'refcount' in 'struct \_zval\_struct'

 retval->refcount = 0;

 \~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:452:65: error: too few arguments to function call, expected 4, have 3

 retval = std\_hnd->read\_property(object, member, type TSRMLS\_CC);

 \~~~~~~~~~~~~~~~~~~~~~~  ^

/Users/edison/zip-1.8.10/php\_zip.c:564:53: error: no member named 'default\_properties' in 'struct \_zend\_class\_entry'

 zend\_hash\_copy(intern->zo.properties, &class\_type->default\_properties, (copy\_ctor\_func\_t) zval\_add\_ref,

 \~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:664:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(filename)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:664:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:664:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:952:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(filename)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:952:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:952:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:1077:6: error: no member named 'safe\_mode' in 'struct \_php\_core\_globals'

 if (OPENBASEDIR\_CHECKPATH(filename)) {

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./php\_zip.h:48:6: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 \~~~^~~~~~~~~~

/usr/local/Cellar/php56/5.6.18/include/php/main/php\_globals.h:32:30: note: expanded from macro 'PG'

\# define PG(v) (core\_globals.v)

 \~~~~~~~~~~~~ ^

/Users/edison/zip-1.8.10/php\_zip.c:1077:6: warning: implicit declaration of function 'php\_checkuid' is invalid in C99 \[-Wimplicit-function-declaration\]

./php\_zip.h:48:22: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:1077:6: error: use of undeclared identifier 'CHECKUID\_CHECK\_FILE\_AND\_DIR'

./php\_zip.h:48:51: note: expanded from macro 'OPENBASEDIR\_CHECKPATH'

 (PG(safe\_mode) && (!php\_checkuid(filename, NULL, CHECKUID\_CHECK\_FILE\_AND\_DIR))) || php\_check\_open\_basedir(filename TSRMLS\_CC)

 ^

/Users/edison/zip-1.8.10/php\_zip.c:1969:43: warning: incompatible pointer types assigning to 'zend\_object\_get\_property\_ptr\_ptr\_t' (aka 'struct

 \_zval\_struct \*\*(\*)(struct \_zval\_struct \*, struct \_zval\_struct \*, int, const struct \_zend\_literal \*)') from 'zval \*\*(zval \*, zval \*)' (aka 'struct

 \_zval\_struct \*\*(struct \_zval\_struct \*, struct \_zval\_struct \*)') \[-Wincompatible-pointer-types\]

 zip\_object\_handlers.get\_property\_ptr\_ptr = php\_zip\_get\_property\_ptr\_ptr;

 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/edison/zip-1.8.10/php\_zip.c:1972:36: warning: incompatible pointer types assigning to 'zend\_object\_read\_property\_t' (aka 'struct \_zval\_struct

 \*(\*)(struct \_zval\_struct \*, struct \_zval\_struct \*, int, const struct \_zend\_literal \*)') from 'zval \*(zval \*, zval \*, int)' (aka 'struct

 \_zval\_struct \*(struct \_zval\_struct \*, struct \_zval\_struct \*, int)') \[-Wincompatible-pointer-types\]

 zip\_object\_handlers.read\_property  \= php\_zip\_read\_property;

 ^ ~~~~~~~~~~~~~~~~~~~~~

10 warnings and 14 errors generated.

make: \*\*\* \[php\_zip.lo\] Error 1

提示如上,求帮助!
我是要打包一个 php_zip.io

关注 0 回答 1

anonymous66 评论了文章 · 2018-05-28

JSONP是什么

一、JSONP的诞生

  • 首先,因为ajax无法跨域,然后开发者就有所思考

  • 其次,开发者发现, <script>标签的src属性是可以跨域的
    把跨域服务器写成 调用本地的函数 ,回调数据回来不就好了?

  • json刚好被js支持(object

  • 调用跨域服务器上动态生成的js格式文件(不管是什么类型的地址,最终生成的返回值都是一段js代码

  • 这种获取远程数据的方式看起来非常像ajax,但其实并不一样
    便于客户端使用数据,逐渐形成了一种非正式传输协议,人们把它称作JSONP

  • 传递一个callback参数给跨域服务端,然后跨域服务端返回数据时会将这个callback参数作为函数名来包裹住json数据即可。

二、老板,来一斤栗子。
【栗子一】
跨域服务器
文件:remote.js
代码:

alert('我是远程文件');

本地

<script type="text/javascript" data-original="跨域服务器/remote.js"></script>

这边做的就是直接引入一个js,页面将会弹出一个提示窗体,显示 我是远程文件

【栗子二】
跨域服务器
文件:remote.js
代码:

localHandler({"result":"我是远程js带来的数据"});

本地

<script type="text/javascript"> 
    var localHandler = function(data){
        alert('我是本地函数,可以被跨域的remote.js文件调用,远程js带来的数据是:' + data.result); 
    }; 
</script> 
<script type="text/javascript" data-original="跨域服务器/remote.js"></script>

这边做的是
1、本地定义一个函数
2、引入一个js
3、被引入的js里面,调用这个函数

页面将会弹出一个提示窗体。显示本地函数被跨域的远程js调用成功,并且还接收到了 我是远程js带来的数据

新问题出现了:让远程js知道它应该调用的本地函数叫什么名字呢?毕竟是jsonp的服务者都要面对很多服务对象,而这些服务对象各自的本地函数都不相同啊?

【栗子三】
跨域服务端提供的js脚本动态生成,这样调用者可以传一个参数过去告诉跨域服务端“我想要一段调用XXX函数的js代码,请你返回给我”,于是跨域服务器就可以按照客户端的需求来生成js脚本并响应了。

跨域服务器
文件:flightResult.php
代码:

flightHandler({
    "code":"CA1998",
    "price": 1780,
    "tickets": 5
});

本地

<script type="text/javascript"> 
    // 得到航班信息查询结果后的回调函数 
    var flightHandler = function(data){
        alert('你查询的航班结果是:票价 ' + data.price + ' 元,' + '余票 ' + data.tickets + ' 张。');
    }; 
    // 提供jsonp服务的url地址(不管是什么类型的地址,最终生成的返回值都是一段javascript代码) 
    var url = "跨域服务器/flightResult.php?code=CA1998&callback=flightHandler";
    // 创建script标签,设置其属性 
    var script = document.createElement('script'); 
    script.setAttribute('src', url); 
    // 把script标签加入head,此时调用开始 
    document.getElementsByTagName('head')[0].appendChild(script); 
</script>

这次我们做的是
1、动态创建脚本
2、url中传递了一个code参数,服务器去做查询CA1998次航班的信息,callback参数告诉服务器,我的本地回调函数叫做flightHandler
3、跨域服务端调用这个函数flightHandler 页面将会弹出一个提示窗体。把票价、余票以及张数给传递回来了。

三、那么服务器到底做了什么呢? 说到底,就是拼接字符串。

// 数据
$data = [
    "name":"anonymous66",
    "age":"18",
    "like":"jianshu"
];
// 接收callback函数名称
$callback = $_GET['callback'];
// 输出
echo $callback . "(" . json_encode($data) . ")";

四、与AJAX的区别是什么?
ajax和jsonp本质上是不同的东西。
ajax的核心是通过XmlHttpRequest获取非本页内容
jsonp的核心则是动态添加<script>标签来调用服务器提供的js脚本

五、结语
本篇文章是对JSONP的原理扫盲,一般很多开发者会使用却不知道原理,这在学习和成长的路上不算好事。so,知道jsonp原理,你又可以加50块工资了。

查看原文

anonymous66 评论了文章 · 2018-05-28

JSONP是什么

一、JSONP的诞生

  • 首先,因为ajax无法跨域,然后开发者就有所思考

  • 其次,开发者发现, <script>标签的src属性是可以跨域的
    把跨域服务器写成 调用本地的函数 ,回调数据回来不就好了?

  • json刚好被js支持(object

  • 调用跨域服务器上动态生成的js格式文件(不管是什么类型的地址,最终生成的返回值都是一段js代码

  • 这种获取远程数据的方式看起来非常像ajax,但其实并不一样
    便于客户端使用数据,逐渐形成了一种非正式传输协议,人们把它称作JSONP

  • 传递一个callback参数给跨域服务端,然后跨域服务端返回数据时会将这个callback参数作为函数名来包裹住json数据即可。

二、老板,来一斤栗子。
【栗子一】
跨域服务器
文件:remote.js
代码:

alert('我是远程文件');

本地

<script type="text/javascript" data-original="跨域服务器/remote.js"></script>

这边做的就是直接引入一个js,页面将会弹出一个提示窗体,显示 我是远程文件

【栗子二】
跨域服务器
文件:remote.js
代码:

localHandler({"result":"我是远程js带来的数据"});

本地

<script type="text/javascript"> 
    var localHandler = function(data){
        alert('我是本地函数,可以被跨域的remote.js文件调用,远程js带来的数据是:' + data.result); 
    }; 
</script> 
<script type="text/javascript" data-original="跨域服务器/remote.js"></script>

这边做的是
1、本地定义一个函数
2、引入一个js
3、被引入的js里面,调用这个函数

页面将会弹出一个提示窗体。显示本地函数被跨域的远程js调用成功,并且还接收到了 我是远程js带来的数据

新问题出现了:让远程js知道它应该调用的本地函数叫什么名字呢?毕竟是jsonp的服务者都要面对很多服务对象,而这些服务对象各自的本地函数都不相同啊?

【栗子三】
跨域服务端提供的js脚本动态生成,这样调用者可以传一个参数过去告诉跨域服务端“我想要一段调用XXX函数的js代码,请你返回给我”,于是跨域服务器就可以按照客户端的需求来生成js脚本并响应了。

跨域服务器
文件:flightResult.php
代码:

flightHandler({
    "code":"CA1998",
    "price": 1780,
    "tickets": 5
});

本地

<script type="text/javascript"> 
    // 得到航班信息查询结果后的回调函数 
    var flightHandler = function(data){
        alert('你查询的航班结果是:票价 ' + data.price + ' 元,' + '余票 ' + data.tickets + ' 张。');
    }; 
    // 提供jsonp服务的url地址(不管是什么类型的地址,最终生成的返回值都是一段javascript代码) 
    var url = "跨域服务器/flightResult.php?code=CA1998&callback=flightHandler";
    // 创建script标签,设置其属性 
    var script = document.createElement('script'); 
    script.setAttribute('src', url); 
    // 把script标签加入head,此时调用开始 
    document.getElementsByTagName('head')[0].appendChild(script); 
</script>

这次我们做的是
1、动态创建脚本
2、url中传递了一个code参数,服务器去做查询CA1998次航班的信息,callback参数告诉服务器,我的本地回调函数叫做flightHandler
3、跨域服务端调用这个函数flightHandler 页面将会弹出一个提示窗体。把票价、余票以及张数给传递回来了。

三、那么服务器到底做了什么呢? 说到底,就是拼接字符串。

// 数据
$data = [
    "name":"anonymous66",
    "age":"18",
    "like":"jianshu"
];
// 接收callback函数名称
$callback = $_GET['callback'];
// 输出
echo $callback . "(" . json_encode($data) . ")";

四、与AJAX的区别是什么?
ajax和jsonp本质上是不同的东西。
ajax的核心是通过XmlHttpRequest获取非本页内容
jsonp的核心则是动态添加<script>标签来调用服务器提供的js脚本

五、结语
本篇文章是对JSONP的原理扫盲,一般很多开发者会使用却不知道原理,这在学习和成长的路上不算好事。so,知道jsonp原理,你又可以加50块工资了。

查看原文

anonymous66 赞了回答 · 2017-09-26

解决PHP命名空间中define和const的区别

这是因为 define 不会考虑命名空间,而 const 会。

简单的说,使用 define 定义时,不会考虑当前的命名空间,所以你两次定义的常量名称重复,会报重复定义。
而使用 const 定义时,会带上命名空间,你两次定义的常量实际是 ROOTweb360\ROOT 。名称不重复,不会报重复定义的错误。

关注 4 回答 3

anonymous66 赞了文章 · 2017-09-25

::class 关键字

要求:PHP >= 5.5

<?php

class User {

}

echo User::class; // return User
<?php
namespace App\Models;

class User {

}
echo User::class; // return App\Models\User

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Phone extends Model
{
    /**
     * Get the user that owns the phone.
     */
    public function user()
    {
        return $this->belongsTo('App\Models\User');
        //return $this->belongsTo(User::class);
    }
}
查看原文

赞 1 收藏 2 评论 3

anonymous66 回答了问题 · 2017-07-07

php 表单自动生成

我写了一个composer,你可以参考看看。
就是为了减去一直重复的表单步骤。
PHPFORM

关注 5 回答 4

anonymous66 关注了用户 · 2017-07-05

高阳Sunny @sunny

SegmentFault 思否 CEO
C14Z.Group Founder
Forbes China 30U30

独立思考 敢于否定

曾经是个话痨... 要做一个有趣的人!

任何问题可以给我发私信或者发邮件 sunny@sifou.com

关注 2148

anonymous66 赞了回答 · 2017-04-19

解决异步获取的数据怎么return出去

楼上说得对,用promise

get:function(){
    return new Promise(function(resolve,reject){
        //ajax...
        $.post("test.php",function(response){
            resolve(response)
        })
        //如果有错的话就reject
    })
}

使用

get().then(function(response){
    //response
}).catch(function(err){
    //错误处理
})

关注 5 回答 3

认证与成就

  • 获得 109 次点赞
  • 获得 24 枚徽章 获得 1 枚金徽章, 获得 5 枚银徽章, 获得 18 枚铜徽章

擅长技能
编辑

开源项目 & 著作
编辑

  • BBCMF

    BBCMF 是一款为后台开发者而生,极大程度上提升了后台开发的时间成本,极易二次开发的一款框架。

  • networkMan

    爬取network记录的方式爬取单页面,例如H5游戏。

注册于 2016-02-22
个人主页被 1.6k 人浏览