# Compiling nginx from sources and including xslt sources

**URL:** <https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006>\
**Category:** NGINX\
**Created:** [February 4, 2016, 4:37pm UTC](https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006 "2016-02-04T16:37:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [February 4, 2016, 4:37pm UTC](https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006/1 "2016-02-04T16:37:21Z")

</div>

Hi,

I’m trying to compile nginx from source but despite providing  
./configure  
with --with-ld-opt I can’t seem to see it.

This is the complete command I’m trying to use.

./configure --prefix=/opt/nginx-1.9.9/conf  
–sbin-path=/opt/nginx-1.9.9/sbin/nginx  
–conf-path=/opt/nginx-1.9.9/conf/nginx.conf  
–pid-path=/opt/nginx-1.9.9/nginx.pid --loc  
k-path=/opt/nginx-1.9.9/nginx.lock  
–error-log-path=/opt/nginx-1.9.9/logs/error.log  
–http-log-path=/opt/nginx-1.9.9/logs/access.log  
–http-client-body-temp-path=/opt/nginx- 1.9.9/lib/body  
–http-fastcgi-temp-path=/opt/nginx-1.9.9/lib/fastcgi  
–http-proxy-temp-path=/opt/nginx-1.9.9/lib/proxy  
–http-scgi-temp-path=/opt/nginx-1.9.9/lib/scgi --http  
-uwsgi-temp-path=/opt/nginx-1.9.9/lib/uwsgi --user=www-data  
–group=www-data  
–with-debug --with-http\_v2\_module --with-http\_gzip\_static\_module  
–with-http\_addition\_module – with-http\_dav\_module  
–with-http\_realip\_module --with-http\_stub\_status\_module  
–with-http\_sub\_module --with-ipv6 --with-mail --with-mail\_ssl\_module  
–with-http\_ssl\_module – with-openssl=/opt/src/nginx/openssl-1\_0\_1g  
–with-sha1=/opt/src/nginx/openssl-1\_0\_1g  
–with-md5=/opt/src/nginx/openssl-1\_0\_1g --with-http\_xslt\_module  
–with-pcre=/opt/src/ng inx/pcre-8.32 --with-pcre-jit  
–with-zlib=/opt/src/nginx/zlib-1.2.8  
–with-ld-opt=“-I/opt/src/nginx/libxml-2.9.3  
-I/opt/src/nginx/xslt-1.1.28”

~Thanks

Posted at Nginx Forum:

> **[compiling nginx from sources and including xslt sources](https://forum.nginx.org/read.php?2,264346,264346#msg-264346)**
>
> Hi, I'm trying to compile nginx from source but despite providing ./configure with --with-ld-opt I can't seem to see it. This is the complete command I'm trying to use. ./configure --prefix=/opt/nginx-1.9.9/conf...

---

<div class="post-metadata">

**Author:** ![orglee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/8e8cbc/32.png) [@orglee](https://www.ruby-forum.com/u/orglee)\
**Post date:** [February 4, 2016, 4:51pm UTC](https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006/2 "2016-02-04T16:51:22Z")

</div>

Hello!

On Thu, Feb 04, 2016 at 10:36:38AM -0500, orglee wrote:

> Hi,
> 
> I’m trying to compile nginx from source but despite providing ./configure  
> with --with-ld-opt I can’t seem to see it.
> 
> This is the complete command I’m trying to use.

[…]

> –with-ld-opt=“-I/opt/src/nginx/libxml-2.9.3  
> -I/opt/src/nginx/xslt-1.1.28”

The --with-ld-opt option is used when calling linker. It makes no  
sense to use “-I” there. If you want to set include paths,  
consider using --with-cc-opt instead.

–  
Maxim D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![orglee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/8e8cbc/32.png) [@orglee](https://www.ruby-forum.com/u/orglee)\
**Post date:** [February 4, 2016, 6:56pm UTC](https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006/3 "2016-02-04T18:56:24Z")

</div>

I’m still getting:

(…)  
checking for libxslt … not found  
checking for libxslt in /usr/local/ … not found  
checking for libxslt in /usr/pkg/ … not found  
checking for libxslt in /opt/local/ … not found

./configure: error: the HTTP XSLT module requires the libxml2/libxslt  
libraries. You can either do not enable the module or install the  
libraries.

Posted at Nginx Forum:

> **[Re: compiling nginx from sources and including xslt sources](https://forum.nginx.org/read.php?2,264346,264350#msg-264350)**
>
> Hi, I'm trying to compile nginx from source but despite providing ./configure with --with-ld-opt I can't seem to see it. This is the complete command I'm trying to use. ./configure --prefix=/opt/nginx-1.9.9/conf...

---

<div class="post-metadata">

**Author:** ![orglee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/8e8cbc/32.png) [@orglee](https://www.ruby-forum.com/u/orglee)\
**Post date:** [February 4, 2016, 7:50pm UTC](https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006/4 "2016-02-04T19:50:44Z")

</div>

Oh ok I’m dumb. 😛

Can I somehow specify those library paths to? I really would like to  
avoid  
compiling them into directory structure of my current system.

Posted at Nginx Forum:

> **[Re: compiling nginx from sources and including xslt sources](https://forum.nginx.org/read.php?2,264346,264359#msg-264359)**
>
> Hi, I'm trying to compile nginx from source but despite providing ./configure with --with-ld-opt I can't seem to see it. This is the complete command I'm trying to use. ./configure --prefix=/opt/nginx-1.9.9/conf...

---

<div class="post-metadata">

**Author:** ![orglee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/8e8cbc/32.png) [@orglee](https://www.ruby-forum.com/u/orglee)\
**Post date:** [February 4, 2016, 7:34pm UTC](https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006/5 "2016-02-04T19:34:58Z")

</div>

Hello!

On Thu, Feb 04, 2016 at 12:55:43PM -0500, orglee wrote:

> I’m still getting:
> 
> (…)  
> checking for libxslt … not found  
> checking for libxslt in /usr/local/ … not found  
> checking for libxslt in /usr/pkg/ … not found  
> checking for libxslt in /opt/local/ … not found
> 
> ./configure: error: the HTTP XSLT module requires the libxml2/libxslt  
> libraries. You can either do not enable the module or install the libraries.

That’s because there are no libxml2/libxslt libraries available  
via the paths you’ve specified. Note that you need libraries to  
be built and installed, just a source code won’t work - nginx  
doesn’t know how to compile libxml2/libxslt for you.

–  
Maxim D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![orglee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/8e8cbc/32.png) [@orglee](https://www.ruby-forum.com/u/orglee)\
**Post date:** [February 5, 2016, 1:56pm UTC](https://www.ruby-forum.com/t/compiling-nginx-from-sources-and-including-xslt-sources/244006/6 "2016-02-05T13:56:03Z")

</div>

Hello!

On Thu, Feb 04, 2016 at 01:50:00PM -0500, orglee wrote:

> Oh ok I’m dumb. 😛
> 
> Can I somehow specify those library paths to? I really would like to avoid  
> compiling them into directory structure of my current system.

Refer to the library docs to find out how to compile them and  
install to some private location. Usually the relevant configure  
option is “–prefix”.

Then use appropriate compiler and linker options to provide paths  
to include files and libraries during nginx compilation.

–  
Maxim D.

> **[nginx](http://nginx.org/)**
