-
Notifications
You must be signed in to change notification settings - Fork 386
Cannot build with nginx-1.11.2 #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@cbj4074 Did you find solution? |
@igreenfield No :( Not yet. |
A wild guess (from the nginx changelog) and not tested
Maybe you could change the include to
and the same for sha1. |
That got it past the initial error, but it appears that ngx_md5.h and md5.h still differ to much-
etc. |
Is there an alternative to this module? it seems like development is pretty much dead. |
Not that in the form of an nginx module, at least that I could find. But there's other solutions like this and there's another jQuery one floating around. |
After looking at the changeset for 1.11.2 here: https://trac.nginx.org/nginx/changeset/6603/nginx (or nginx/nginx@c60b61a) and scroll down to src/core/ngx_md5.h you can see that the definition for MD5_CTX was removed. So it is trying to find something that does not exist anymore which is why the make errors out. Also the SHA_CTX typedef was removed in the sha1.h file in the same commit. After messing around (I have little experience in C) I deduced that the openssl libs that this module is relying on are missing because of the changes to the core of nginx removing these references (maybe a bug on nginx's part?). There are also definitions for sha265 and other higher encryption functions that nginx does not support in its core such as 'SHA256_CTX'. So changing the top section of the file and removing all of the if/then statements and including everything I got the module to compile without error. You also need to change the old references to the local files as per @dup2. Does it work the same? I have no idea. I have not had a chance to test it yet. Please test and let me know. Also I am sure the changes can be optimized so please do so. Will put up a pull request momentarily. For reference the top of my ngx_http_upload_module.c is now #include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <nginx.h>
#include <openssl/md5.h>
#include <ngx_md5.h>
#define MD5Init MD5_Init
#define MD5Update MD5_Update
#define MD5Final MD5_Final
#include <openssl/sha.h>
#include <ngx_sha1.h>
#define MULTIPART_FORM_DATA_STRING "multipart/form-data" To get to compile you still need to apply this patch - https://github.com/vkholodkov/nginx-upload-module/pull/77 |
@Austinb Nice! I will give this a try in the next day or two and report back. Thank you! |
@Austinb @cbj4074 you do not need to include both the openssl and ngx implementations afaik. I tested the md5 and sha1 generation with the following adaptation:
I'm not sure if you need to explicitly specify an openssl library but I compiled with the |
@tkoenig Thanks for the info. I just ran a quick one without the ngx_* header files and it compiled fine. You shouldn't need to use I ran some quick upload tests a few days ago and it appears to work the same. Has anyone else tested the actual upload side in 1.11.2? |
@Austinb Thanks for the info. Uploads work fine for me with 1.11.2 and the upload module (partial & non-partial uploads). |
Updated pull request #80 not that it will make much difference since there a long standing patches yet to be merged in. |
no solution yet? :( |
@WeOggy I have a branch that has both the #77 and #80 patches in it. Not sure #77 is needed anymore as of 1.11.5. You can pull https://github.com/Austinb/nginx-upload-module in place of the existing path but make sure you change to branch 2.2. I kept the layout the same. As far as this repo I am not sure the author is even checking up on it anymore. Last merge was 2014 so sadly we maybe out of luck keeping this repo up to date. |
- release version number tracks nginx's version - caveat: downgrade in version number from 4 to 1.11.7 may cause problems - upgrade nginx from 1.11.1 to 1.11.7 - add IPv6/gunzip/http_v2 module support - removed nginx-upload-module-2.2 - hasn't been updated since ['08](https://github.com/vkholodkov/nginx-upload-module) - won't [compile easily for nginx 1.11.2+](https://github.com/vkholodkov/nginx-upload-module/issues/79) - was included for GoCD front-end, which has long since been abandoned. fixes: ``` ../nginx-upload-module-2.2/ngx_http_upload_module.c:14:17: fatal error: md5.h: No such file or directory #include <md5.h> ^ compilation terminated. make[1]: *** [objs/addon/nginx-upload-module-2.2/ngx_http_upload_module.o] Error 1 ```
I have the same problem,used this https://github.com/Austinb/nginx-upload-module fixed it. my nginx version is nginx-1.13.1. under the configuration info:
make info: |
This appears to be fixed via https://github.com/vkholodkov/nginx-upload-module/pull/88 For the sake of thoroughness, it's necessary to build using the 2.255 tag from https://github.com/vkholodkov/nginx-upload-module/tree/2.255 . I don't believe this fix to have been merged into the 2.2 branch as yet. THANK YOU to all involved! |
When building against 1.11.2+, requires additional -lcrypto dependency. (Nginx changed crypto approach and dependencies for openssl are no longer default) More details found here: https://github.com/vkholodkov/nginx-upload-module/issues/79 Resolves: objs/addon/nginx-upload-70bee48f1811eecd255ed094ce9f0fb560c390c3/ngx_http_upload_module.o \ objs/ngx_modules.o \ -ldl -lpthread -lpthread -lpcre -lz -latomic_ops \ -Wl,-E ngx_http_upload_module.o: In function `ngx_http_upload_flush_output_buffer': ngx_http_upload_module.c:1625: undefined reference to `MD5_Update' ngx_http_upload_module.c:1628: undefined reference to `SHA1_Update' ngx_http_upload_module.c:1631: undefined reference to `SHA256_Update' ngx_http_upload_module.c:1634: undefined reference to `SHA512_Update' Signed-off-by: Matthew Weber <matthew.l.weber@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
This error is back again as of
nginx-1.11.2
:Curiously, the exact same configure options that fail with
nginx-1.11.2
"work fine" withnginx-1.10.1
, in the sense that the build process seems to succeed, but then I get "unknown directive upload_progress".I've gone back through some of the stable builds that I've used in the past, and this plugin still compiles and works with
nginx-1.8.1
. So, it seems something in nginx has changed and needs to be updated in the plugin.Thanks!
The text was updated successfully, but these errors were encountered: