Nginx i biblioteka pcre

Tematy związane z oprogramowaniem, instalacją, konfiguracją
Awatar użytkownika
Gordon1x
Posty: 78
Rejestracja: 30 sierpnia 2007, 17:23
Lokalizacja: Polska

Nginx i biblioteka pcre

Post autor: Gordon1x »

Kod: Zaznacz cały

Nowy-1X:/home/nowy# nginx
2007/11/17 14:02:36 [emerg] 3587#0: the using of the regex "\.php$" requires PCRE library in /usr/local/nginx/conf/nginx.conf:65
Zainstalowałem brakującą bibliotekę tylko nie wiem w jakim katalogu się znajduje, aby podać ścieżkę w pliku konfiguracyjnym.
Czy ktoś może napisać w jakim katalogu się znajduje biblioteka PCRE ?
Awatar użytkownika
ruun
Member
Posty: 1366
Rejestracja: 29 marca 2007, 21:07
Lokalizacja: Kruszwica

Post autor: ruun »

Zapewne w /usr/lib/
Awatar użytkownika
Gordon1x
Posty: 78
Rejestracja: 30 sierpnia 2007, 17:23
Lokalizacja: Polska

Post autor: Gordon1x »

ruun pisze:Zapewne w /usr/lib/
W tym katalogu biblioteka znajduje się pod nazwą libpcre.so

Podczas kompilacji serwera zostaje zwrócony błąd i nie mogę poradzić sobie z jego rozwiązaniem.

Kod: Zaznacz cały

NOWY-1X:/home/nowy/Serwery/nginx-0.6.17# ./configure --prefix=/usr/local --with-pcre=/usr/lib --with-http_ssl_module  --without-http_rewrite_module --without-http_gzip_module --without-http_proxy_module && make && make install
checking for OS
 + Linux 2.6.18-4-686 i686
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
checking for gcc -pipe switch ... found
checking for gcc variadic macros ... found
checking for C99 variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for crypt.h ... found
checking for malloc.h ... found
checking for Linux specific features
 + rt signals found
checking for epoll ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for OpenSSL library ... found
checking for int size ... 4 bytes
checking for long size ... 4 bytes
checking for long long size ... 8 bytes
checking for void * size ... 4 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system endianess ... little endianess
checking for size_t size ... 4 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 4 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for strerror_r() ... found but is not working
checking for gnu style strerror_r() ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for sched_yield() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found

Configuration summary
  + threads are not used
  + using PCRE library: /usr/lib
  + using system OpenSSL library
  + md5 library is not used
  + sha1 library is not used
  + zlib library is not used

  nginx path prefix: "/usr/local"
  nginx binary file: "/usr/local/sbin/nginx"
  nginx configuration prefix: "/usr/local/conf"
  nginx configuration file: "/usr/local/conf/nginx.conf"
  nginx pid file: "/usr/local/logs/nginx.pid"
  nginx error log file: "/usr/local/logs/error.log"
  nginx http access log file: "/usr/local/logs/access.log"
  nginx http client request body temporary files: "/usr/local/client_body_temp"
  nginx http proxy temporary files: "/usr/local/proxy_temp"
  nginx http fastcgi temporary files: "/usr/local/fastcgi_temp"

make -f objs/Makefile
make[1]: Wejście do katalogu `/home/nowy/Serwery/nginx-0.6.17'
cd /usr/lib \
        && if [ -f Makefile ]]: *** [/usr/lib/Makefile] Błąd 127
make[1]: Opuszczenie katalogu `/home/nowy/Serwery/nginx-0.6.17'
make: *** [build] Błąd 2

P.S.
Bardzo proszę o pomoc w rozwiązaniu problemu.
Awatar użytkownika
ruun
Member
Posty: 1366
Rejestracja: 29 marca 2007, 21:07
Lokalizacja: Kruszwica

Post autor: ruun »

A dlaczego nie instalujesz z paczki?

Kod: Zaznacz cały

aptitude install nginx
Awatar użytkownika
Gordon1x
Posty: 78
Rejestracja: 30 sierpnia 2007, 17:23
Lokalizacja: Polska

Post autor: Gordon1x »

Zainstalowałem program z paczki.

Próbowałem skonfigurować obsługę skryptów php.

Skrypt uruchamiający proces fastcgi:

Kod: Zaznacz cały

#!/bin/bash
 
## ABSOLUTE path to the PHP binary
PHPFCGI="/usr/lib/cgi-bin/php5"
 
## tcp-port to bind on
FCGIPORT="9000"
 
## IP to bind on
FCGIADDR="127.0.0.1"
 
## number of PHP children to spawn
PHP_FCGI_CHILDREN=1
 
## number of request before php-process will be restarted
PHP_FCGI_MAX_REQUESTS=50
 
# allowed environment variables sperated by spaces
ALLOWED_ENV="ORACLE_HOME PATH USER"
 
## if this script is run as root switch to the following user
USERID=nobody
 
################## no config below this line
 
if test x$PHP_FCGI_CHILDREN = x; then
  PHP_FCGI_CHILDREN=4
fi
 
ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_CHILDREN"
ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS"
ALLOWED_ENV="$ALLOWED_ENV FCGI_WEB_SERVER_ADDRS"
 
if test x$UID = x0; then
  EX="/bin/su -m -c \"$PHPFCGI -q -b $FCGIADDR:$FCGIPORT\" $USERID"
else
  EX="$PHPFCGI -b $FCGIADDR:$FCGIPORT"
fi
 
echo $EX
 
# copy the allowed environment variables
E=
 
for i in $ALLOWED_ENV; do
  E="$E $i=${!i}"
done
 
# clean environment and set up a new one
nohup env - $E sh -c "$EX" &> /dev/null &
Plik konfiguracyjny nginx.conf

Kod: Zaznacz cały

user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    access_log	/var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;

    server {
        listen       80;
        server_name  localhost;

        access_log  /var/log/nginx/localhost.access.log;

        location / {
            root   /var/www/nginx-default;
            index  index.php index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        #location = /50x.html {
        #    root   /var/www/nginx-default;
        #}

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        location ~ \.php$ {
            proxy_pass   [url]http://127.0.0.1;[/url]
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    #    ssl_prefer_server_ciphers   on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
Plik konfiguracyjny fastcgi_params

Kod: Zaznacz cały


fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;
Problem polega na tym, że pliki php nie są interpretowane, a serwer zwraca ich kod źródłowy.

[ Dodano: 2007-11-20, 11:06 ]
Czy ktoś może pomóc w poprawnym skonfigurowaniem serwera nginx i php?

PHP - pakiet zainstalowany z paczki (php- cgi)
NGINX - pakiet zainstalowany z paczki

P.S.
Pilnie proszę o pomoc.
ODPOWIEDZ