rryqszq4 / ngx-php

ngx-php - Embedded php7 or php8 scripting language for nginx module. Mainline development version of the ngx-php.
BSD 2-Clause "Simplified" License
627 stars 56 forks source link

nginx make fail #4

Open domyway opened 6 years ago

domyway commented 6 years ago
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:381:5: error: use of undeclared identifier 'ndk_set_var_t'
    ndk_set_var_t filter;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:395:5: error: use of undeclared identifier 'filter'
    filter.type = NDK_SET_VAR_MULTI_VALUE_DATA;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:395:19: error: use of undeclared identifier 'NDK_SET_VAR_MULTI_VALUE_DATA'
    filter.type = NDK_SET_VAR_MULTI_VALUE_DATA;
                  ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:396:5: error: use of undeclared identifier 'filter'
    filter.func = cmd->post;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:397:5: error: use of undeclared identifier 'filter'
    filter.size = cf->args->nelts - 3;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:404:25: error: use of undeclared identifier 'filter'
    filter_data->size = filter.size;
                        ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:413:5: error: use of undeclared identifier 'filter'
    filter.data = filter_data;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:415:12: error: implicit declaration of function 'ndk_set_var_multi_value_core' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return ndk_set_var_multi_value_core(cf, &target, &value[3], &filter);
           ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:415:66: error: use of undeclared identifier 'filter'
    return ndk_set_var_multi_value_core(cf, &target, &value[3], &filter);
                                                                 ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:423:5: error: use of undeclared identifier 'ndk_set_var_t'
    ndk_set_var_t filter;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:437:5: error: use of undeclared identifier 'filter'
    filter.type = NDK_SET_VAR_MULTI_VALUE_DATA;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:437:19: error: use of undeclared identifier 'NDK_SET_VAR_MULTI_VALUE_DATA'
    filter.type = NDK_SET_VAR_MULTI_VALUE_DATA;
                  ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:438:5: error: use of undeclared identifier 'filter'
    filter.func = cmd->post;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:439:5: error: use of undeclared identifier 'filter'
    filter.size = cf->args->nelts - 3;
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:446:25: error: use of undeclared identifier 'filter'
    filter_data->size = filter.size;
                        ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:455:5: error: implicit declaration of function 'PHP_EMBED_START_BLOCK' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    PHP_EMBED_START_BLOCK(0, NULL);
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:459:31: error: use of undeclared identifier 'IS_BOOL'
        if (Z_TYPE(retval) == IS_BOOL ||
                              ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:475:5: error: implicit declaration of function 'PHP_EMBED_END_BLOCK' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    PHP_EMBED_END_BLOCK();
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:475:5: note: did you mean 'PHP_EMBED_START_BLOCK'?
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:455:5: note: 'PHP_EMBED_START_BLOCK' declared here
    PHP_EMBED_START_BLOCK(0, NULL);
    ^
/Users/weizhao/Downloads/ngx_php7/src/ngx_http_php_directive.c:484:5: error: use of undeclared identifier 'filter'
    filter.data = filter_data;
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [objs/addon/src/ngx_http_php_directive.o] Error 1
make: *** [build] Error 2

PHP 7.0.7 (cli) (built: Jun 23 2016 18:14:55) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

nginx-1.11.10

macOS sierra 10.12.5 (16F73)

rryqszq4 commented 6 years ago

@domyway Fixd Add module ngx_devel_kit. Please recompile it.

$ wget 'http://php.net/distributions/php-7.0.23.tar.gz'
$ tar xf php-7.0.23.tar.gz
$ cd php-7.0.23

$ ./configure --prefix=/path/to/php --enable-embed
$ make && make install

$ git clone https://github.com/rryqszq4/ngx_php7.git

$ wget 'http://nginx.org/download/nginx-1.6.3.tar.gz'
$ tar -zxvf nginx-1.6.3.tar.gz
$ cd nginx-1.6.3

$ export PHP_BIN=/path/to/php/bin
$ export PHP_INC=/path/to/php/include/php
$ export PHP_LIB=/path/to/php/lib

$ ./configure --user=www --group=www \
$             --prefix=/path/to/nginx \
$             --with-ld-opt="-Wl,-rpath,$PHP_LIB" \
$             --add-module=/path/to/ngx_php7/dev/ngx_devel_kit \
$             --add-module=/path/to/ngx_php7
andaniel2029 commented 4 years ago

Hi, everybody.

I got make install errors also.

Hope your positive reply soon.


objs/addon/impl/php_ngx_var.o \ objs/addon/impl/php_ngx_sockets.o \ objs/addon/impl/php_ngx_header.o \ objs/addon/impl/php_ngx_cookie.o \ objs/ngx_modules.o \ -Wl,-rpath,/usr/lib64/php -ldl -lpthread -lcrypt -lcrypt -largon2 -lresolv -lcrypt -ledit -lncurses -lstdc++ -lz -lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcrypt -largon2 -lcrypt -L/usr/lib64/php -lphp7 -lpcre -lz \ -Wl,-E sed -e "s|%%PREFIX%%|/root/php-7.3.10/nginx-1.17.8|" \ -e "s|%%PID_PATH%%|/root/php-7.3.10/nginx-1.17.8/logs/nginx.pid|" \ -e "s|%%CONF_PATH%%|/root/php-7.3.10/nginx-1.17.8/conf/nginx.conf|" \ -e "s|%%ERROR_LOG_PATH%%|/root/php-7.3.10/nginx-1.17.8/logs/error.log|" \ < man/nginx.8 > objs/nginx.8 make[1]: Leaving directory /root/php-7.3.10/nginx-1.17.8' make -f objs/Makefile install make[1]: Entering directory/root/php-7.3.10/nginx-1.17.8' test -d '/root/php-7.3.10/nginx-1.17.8' || mkdir -p '/root/php-7.3.10/nginx-1.17.8' test -d '/root/php-7.3.10/nginx-1.17.8/sbin' \ || mkdir -p '/root/php-7.3.10/nginx-1.17.8/sbin' test ! -f '/root/php-7.3.10/nginx-1.17.8/sbin/nginx' \ || mv '/root/php-7.3.10/nginx-1.17.8/sbin/nginx' \ '/root/php-7.3.10/nginx-1.17.8/sbin/nginx.old' cp objs/nginx '/root/php-7.3.10/nginx-1.17.8/sbin/nginx' test -d '/root/php-7.3.10/nginx-1.17.8/conf' \ || mkdir -p '/root/php-7.3.10/nginx-1.17.8/conf' cp conf/koi-win '/root/php-7.3.10/nginx-1.17.8/conf' cp: ‘conf/koi-win’ and ‘/root/php-7.3.10/nginx-1.17.8/conf/koi-win’ are the same file make[1]: ** [install] Error 1 make[1]: Leaving directory `/root/php-7.3.10/nginx-1.17.8' make: [install] Error 2**


Centos 7 Vps PHP 7.3.15 (cli) (built: Feb 18 2020 09:25:23) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.15, Copyright (c) 1998-2018 Zend Technologies Nginx 1.17.8

Thank you.

rryqszq4 commented 4 years ago

@andaniel2029 Maybe you set the configure prefix to / root / php-7.3.10 / nginx-1.17.8, but this is also the directory for the nginx source code. So reset the prefix to change another directory.

andaniel2029 commented 4 years ago

@andaniel2029 Maybe you set the configure prefix to / root / php-7.3.10 / nginx-1.17.8, but this is also the directory for the nginx source code. So reset the prefix to change another directory.

I changed it, but got same error.

rryqszq4 commented 4 years ago

Thank you for your reply. Can we talk more? My skype id is live:andaniel2029. What's your skype? Thanks again. On Tue, Mar 17, 2020 at 10:30 PM rryqszq4 @.***> wrote: @andaniel2029 https://github.com/andaniel2029 Maybe you set the configure prefix to / root / php-7.3.10 / nginx-1.17.8, but this is also the directory for the nginx source code. So reset the prefix to change another directory. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#4 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFS7MDHVMX5CCFQ5T7TBVTRH6JQ3ANCNFSM4EBCG2PA .

Sorry, I donot have skype, you can check configure again or show it here.

andaniel2029 commented 4 years ago

I used following command.

./configure --user=www --group=www \ --prefix=/root/php-7.3.10/nginx \ --with-ld-opt="-Wl,-rpath,$PHP_LIB" \ --add-module=/root/php-7.3.10/ngx_php7/third_party/ngx_devel_kit \ --add-module=/root/php-7.3.10/ngx_php7

andaniel2029 commented 4 years ago

Also i have issue about docker build.

[root@alsco ngx_php7]# docker build -t ngx_php7 . Sending build context to Docker daemon 1.167 MB Step 1/10 : FROM nginx:stable-alpine as ngx-php Error parsing reference: "nginx:stable-alpine as ngx-php" is not a valid repository/tag: invalid reference format [root@alsco ngx_php7]#

Hope your help. Regards.

rryqszq4 commented 4 years ago

I used following command.

./configure --user=www --group=www --prefix=/root/php-7.3.10/nginx --with-ld-opt="-Wl,-rpath,$PHP_LIB" --add-module=/root/php-7.3.10/ngx_php7/third_party/ngx_devel_kit --add-module=/root/php-7.3.10/ngx_php7

Your prefix directory is / root / php-7.3.10 / nginx, what is your nginx source directory? Is it / root / php-7.3.10 / nginx-1.17.8? If yes, what is the error?

rryqszq4 commented 4 years ago

Also i have issue about docker build.

[root@alsco ngx_php7]# docker build -t ngx_php7 . Sending build context to Docker daemon 1.167 MB Step 1/10 : FROM nginx:stable-alpine as ngx-php Error parsing reference: "nginx:stable-alpine as ngx-php" is not a valid repository/tag: invalid reference format [root@alsco ngx_php7]#

Hope your help. Regards.

OK, Thanks report.

soulteary commented 3 years ago

If you are still using or want to use this project, you can consider using the pre-built binaries in this image :D @andaniel2029 @domyway

docker pull soulteary/prebuilt-nginx-modules:ngx-1.21.1-php-master-alpine

Using docker multi-stage build, you can get a clean self-made image.

detail: https://github.com/rryqszq4/ngx_php7/issues/131