nginx-modules / nginx-minify

Simple NGINX minify using Perl5 for CSS/JavaScript/HTML5
56 stars 18 forks source link

Minify.pm locate error #2

Closed aeke closed 8 years ago

aeke commented 8 years ago

When I startup again nginx gives error:

require_pv("Minify.pm") failed: "Can't locate Minify.pm in @INC (you may need to install the Minify module) (@INC contains: /usr/share/nginx/perl /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at (eval 1) line 1."

denji commented 8 years ago

Provide the dump nginx -V?

aeke commented 8 years ago
nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1) 
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_secure_link_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/headers-more-nginx-module --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-auth-pam --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-cache-purge --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-development-kit --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-echo --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/ngx-fancyindex --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-http-push --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-lua --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-upload-progress --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-upstream-fair --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/ngx_http_substitutions_filter_module
denji commented 8 years ago

Looks like the package maintainer ubuntu is built incorrectly/buggy --prefix=/usr/share/nginx (perl_modules perl; -> /usr/share/nginx/perl)


Official repositories nginx

$ lsb_release -d
Description:    Ubuntu 15.10
$ nginx -V
nginx version: nginx/1.9.12
built by gcc 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2)
built with OpenSSL 1.0.2d 9 Jul 2015
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx
dipenpatel235 commented 8 years ago

nginx: [emerg] require_pv("Javascript/Minifier.pm") failed: "Can't locate Javascript/Minifier.pm in @INC (@INC contains: /usr/local/nginx/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 1) line 1." nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

dipenpatel235 commented 8 years ago

My nginx.conf file content is

   perl_modules perl;

  # Get this module from the CPAN and put the file in this directory.
  # or install it systemwide
  perl_require Javascript/Minifier.pm;
  perl_require Minify.pm;
denji commented 8 years ago

Ubuntu/Debian

sudo apt-get install -y libjavascript-minifier-xs-perl \
     libcss-minifier-xs-perl libhtml-packer-perl
js
---
libjavascript-minifier-perl/xenial,xenial 1.11-1 all
  Perl extension for minifying JavaScript code

libjavascript-minifier-xs-perl/xenial 0.11-1build1 amd64
  XS based JavaScript minifier
  ^^^^^

libjavascript-packer-perl/xenial,xenial 2.00-1 all
  module to compact JavaScript code

css
---
libcss-minifier-perl/xenial,xenial 0.01-1 all
  Perl extension for minifying CSS

libcss-minifier-xs-perl/xenial 0.09-2build1 amd64
  XS based CSS minifier
  ^^^^^

libcss-packer-perl/xenial,xenial 1.002001-1 all
  fast pure perl CSS cleaner

html
---

libhtml-packer-perl/xenial,xenial 2.020000-1 all
  perl module for cleaning the HTML code
  ^^^^^
dipenpatel235 commented 8 years ago

Thanks but i have centos and i have installed below package already

yum install perl-ExtUtils-Embed perl-JavaScript-Minifier

in cpan i have installed below two package also JavaScript::Minifier http://search.cpan.org/~pmichaux/JavaScript-Minifier/lib/JavaScript/Minifier.pm CSS::Minifier http://search.cpan.org/~pmichaux/CSS-Minifier-0.01/lib/CSS/Minifier.pm

On Sat, Apr 9, 2016 at 1:02 PM, Denis Denisov notifications@github.com wrote:

Ubuntu/Debian:

libjavascript-minifier-perl/xenial,xenial 1.11-1 all Perl extension for minifying JavaScript code

libjavascript-minifier-xs-perl/xenial 0.11-1build1 amd64 XS based JavaScript minifier

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/nginx-modules/nginx-minify/issues/2#issuecomment-207733936

Thanks & Regards

Dipen B.Patel | Embedded Linux Developer Mo : +91 9909013212 Email:dipen.ec2010@gmail.com