It's been a long time since Christmas and I haven't sent 51 blog posts. I have been busy with exams and other private affairs recently. I feel it is a little bad if I don't post a blog post for a long time. It's not just a Summary of the last few things. They are all about exam-related things. It hurts! I used to help my friends build the website environment. I thought of an article that I was trying to publish with incorrect summary. I forgot about it. I 'd like to publish it today. Haha!
An error occurred while compressing and optimizing Apache configurations -- undefined symbol: inflateEnd
Environment: CentOS 6.4 Software Version: httpd-2.4.6 apr-1.4.8 apr-util-1.5.2 other software and libraries files: yum-y groupinstall "Development tools" "Server Platform Development" yum-y install pcre-devel
Problem description:
When we perform compression Optimization on apache, after I add mod_deflate in DSO mode and configure the compression parameters, check whether the following error occurs in the Syntax:
Httpd: Syntax error on line 102 of/application/apache2.4.6/conf/httpd. conf: Cannot load modules/mod_deflate.so into server:/application/apache2.4.6/modules/mod_deflate.so: undefined symbol: inflateEnd
Solution:
1. First check the httpd. conf and the configuration in the httpd-vhosts.conf, there is no error; then view the output information when mod_deflate is compiled, there is no error. 2. I have Baidu's inflateEnd. The first one is that the search entry is zlib's Baidu encyclopedia. Then I went to google to search for inflateEnd. The search entry told me that inflateEnd belongs to zlib. in the lib library file. 3. Then I found someone who had encountered similar problems in the past under google, they are in the apr master configuration file apr-1-config old version may be apr-conf) modify LDFLAGS = "" To LDFLAGS = "-lz", and then use apxs to re-compile mod_deflate.c. Then, the apache service is normal and files can be compressed normally.
Another solution to this problem:You need to load zlib before LoadModule deflate_module modules/mod_deflate.so. so if the operating system is 32, add LoadFile/usr/lib/libz in the previous line of LoadModule deflate_module modules/mod_deflate.so. so. For a 64-bit operating system, add LoadFile/usr/lib64/libz. so to the last line of LoadModule deflate_module modules/mod_deflate.so.
The following is information about LDFLAGS and lz:
I. gcc applications-Shared generates a shared target file, which can be connected to other target files to generate executable files. only some systems support this option. -Wl and option pass the option to the connector. if the option contains a comma, separate multiple options. -w does not generate any warning information. -Wall generates all warning information. Lc is link libclm. It is link libmlz. It is the library file to be linked by link libz-l. Assume that the library file name is libxxx. so, the link command is-lxxx; the libraries in/lib and/usr/local/lib can be directly linked using the-l parameter.
-L specify the directory where the library file is located
Ii. Makefile optionsCFLAGS indicates the options used in the C compiler. CXXFLAGS indicates the options used for the C ++ compiler.
These two variables actually cover the compilation and compilation steps.
CFLAGS: Specifies the path of the header file. h file, for example, CFLAGS =-I/usr/include-I/path/include. Similarly, when installing a package, an include directory will be created in the installation path. When there is a problem during the installation process, try to add the include directory of the previously installed package to this variable. LDFLAGS: optimization parameters used by gcc and other compilers. You can also specify the location of the library file. Usage: LDFLAGS =-L/usr/lib-L/path/to/your/lib. Each package is installed with a lib directory. If a package is obviously installed, and when another package is installed, it cannot be found. You can try using the LDFALGS added to the lib path of the package. LIBS: Tell the linker which library files to link, such as LIBS =-lpthread-liconv. In short, LDFLAGS tells the linker where to find the library files, LIBS tells the linker which library files to link. However, these two parameters are added during the link phase, so even if you swap these two values, there is no problem. Sometimes, although LDFLAGS specify-L to allow the linker to find the library and link it to, the runtime linker cannot find this library. If you want to extend the path of the library file during software runtime, then we need to add these two libraries to "-Wl, R": LDFLAGS =-L/var/xxx/lib-L/opt/mysql/lib-Wl, r/var/xxx/lib-Wl, R/opt/mysql/lib if it is being executed. /configure previously set the environment variable export LDFLAGS = "-L/var/xxx/lib-L/opt/mysql/lib-Wl, R/var/xxx/lib-Wl, r/opt/mysql/lib ". Note that no space is allowed on both sides of the environment variable equal sign and the shell quotation marks must be added ). After configure is executed, Makefile will set this option. This parameter will be used during the link, and the library file search path of the compiled executable program will be extended.
This article is from the Not Only Linux blog, please be sure to keep this source http://nolinux.blog.51cto.com/4824967/1345264