Ответы пользователя по тегу PHP
  • Почему при переносе сайта из денвера на сервер появляется ошибка?

    @neonox
    Не знаю Вашу архитектуру, но первый вопрос - пути в конфиге поменяли?
    Ответ написан
    Комментировать
  • Какие посоветуете уроки по PHP?

    @neonox
    По своему опыту могу посоветовать:
    1. Курсы от "Специалист", которые ведет Борисов Игорь Олегович. Лично я от него без ума
    2. Книга "Изучаем PHP и MySQL" от O'Reilly
    Ответ написан
    1 комментарий
  • Проблема с загрузкой файлов на сервер

    @neonox Автор вопроса
    /etc/nginx/conf.d/*.conf; — директория пуста
    /etc/nginx/sites-enabled/*; — default -> /etc/nginx/sites-available/default

    nginx.domain
    server {
    listen 146.185.163.91:443;
    server_name 146.185.163.91;
    ssl on;
    ssl_certificate /usr/local/ispmgr/etc/manager.crt;
    ssl_certificate_key /usr/local/ispmgr/etc/manager.key;
    include /usr/local/ispmgr/etc/nginx.inc;
    location / {
    proxy_pass $mgr_proxy;
    proxy_redirect $mgr_proxy /;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Secret bESRiYs0ISJHx60m/ypwyjvG;
    chunked_transfer_encoding off;
    }
    location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Secret bESRiYs0ISJHx60m/ypwyjvG;
    }
    }


    Увеличил время до 1000, файл загрузился полностью, но потом выдало 500 ошибку

    [Sun Nov 03 23:37:00 2013] [warn] [client 5.143.172.103] mod_fcgid: HTTP request length 133905 (so far) exceeds MaxRequestLen (131072), referer: http://imanit.ru/administrator/index.php?option=com_jshopping&controller=update
    Ответ написан
    Комментировать
  • Проблема с загрузкой файлов на сервер

    @neonox Автор вопроса
    Ошибка осталась, но записались вот такие логи

    5.143.172.103 — - [03/Nov/2013:23:05:39 +0400] "-" 408 0 "-" "-"
    5.143.172.103 — - [03/Nov/2013:23:05:39 +0400] "-" 408 0 "-" "-"
    5.143.172.103 — - [03/Nov/2013:23:06:27 +0400] "-" 400 0 "-" "
    Ответ написан
  • Проблема с загрузкой файлов на сервер

    @neonox Автор вопроса
    Спасибо за инструкцию)))

    Увы, но ошибка продолжает идти, при загрузке файла в 2,5 МБ вижу родное окошко. В логах ngnix ничего нет связанного с моей проблемой

    Сейчас конфиг выглядит вот так

    Скрытый текст
    user www-data;worker_processes 4;
    pid /var/run/nginx.pid;

    events {
    worker_connections 768;
    multi_accept on;
    }

    http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

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

    ##
    # Logging Settings
    ##

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

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable «msie6»;

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    include /usr/local/ispmgr/etc/nginx.domain;
    log_format isp '$bytes_sent $request_length';

    server {
    server_name imanit.ru www.imanit.ru;
    listen 146.185.163.91;
    disable_symlinks if_not_owner from=$root_path;
    set $root_path /var/www/imanit_msk/data/www/imanit.ru;
    location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
    root $root_path;
    access_log /var/www/nginx-logs/imanit_msk isp;
    access_log /var/www/httpd-logs/imanit.ru.access.log;
    error_page 404 = @fallback;
    client_max_body_size 100m;

    }
    location / {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;

    }

    location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location @fallback {
    proxy_pass 146.185.163.91:81;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location ^~ /webstat/ {
    auth_basic «Restricted area»;
    auth_basic_user_file /var/www/imanit_msk/data/etc/1969260.passwd;
    try_files $uri @fallback;
    }
    include /usr/local/ispmgr/etc/nginx.inc;
    }
    server {
    server_name i-manit.ru www.i-manit.ru;
    listen 146.185.163.91;
    disable_symlinks if_not_owner from=$root_path;
    set $root_path /var/www/imanit_tver/data/www/i-manit.ru;
    location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
    root $root_path;
    access_log /var/www/nginx-logs/imanit_tver isp;
    access_log /var/www/httpd-logs/i-manit.ru.access.log;
    error_page 404 = @fallback;
    client_max_body_size 100M;
    }
    location / {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location @fallback {
    proxy_pass 146.185.163.91:81;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location ^~ /webstat/ {
    auth_basic «Restricted area»;
    auth_basic_user_file /var/www/imanit_tver/data/etc/1969352.passwd;
    try_files $uri @fallback;
    }
    include /usr/local/ispmgr/etc/nginx.inc;
    }
    }

    #mail {
    # # See sample authentication script at:
    # # wiki.nginx.org/ImapAuthenticateWithApachePhpScript
    #
    # # auth_http localhost/auth.php;
    # # pop3_capabilities «TOP» «USER»;
    # # imap_capabilities «IMAP4rev1» «UIDPLUS»;
    #
    # server {
    # listen localhost:110;
    # protocol pop3;
    # proxy on;
    # }
    #
    # server {
    # listen localhost:143;
    # protocol imap;
    # proxy on;
    # }
    #}
    Ответ написан
    Комментировать
  • Проблема с загрузкой файлов на сервер

    @neonox Автор вопроса
    Скрытый текст
    user www-data;worker_processes 4;
    pid /var/run/nginx.pid;

    events {
    worker_connections 768;
    # multi_accept on;
    }

    http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

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

    ##
    # Logging Settings
    ##

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

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable «msie6»;

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    include /usr/local/ispmgr/etc/nginx.domain;
    log_format isp '$bytes_sent $request_length';

    server {
    server_name imanit.ru www.imanit.ru;
    listen 146.185.163.91;
    disable_symlinks if_not_owner from=$root_path;
    set $root_path /var/www/imanit_msk/data/www/imanit.ru;
    location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
    root $root_path;
    access_log /var/www/nginx-logs/imanit_msk isp;
    access_log /var/www/httpd-logs/imanit.ru.access.log;
    error_page 404 = @fallback;
    }
    location / {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    client_max_body_size 100m;
    client_body_buffer_size 256k;
    }

    location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location @fallback {
    proxy_pass 146.185.163.91:81;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location ^~ /webstat/ {
    auth_basic «Restricted area»;
    auth_basic_user_file /var/www/imanit_msk/data/etc/1969260.passwd;
    try_files $uri @fallback;
    }
    include /usr/local/ispmgr/etc/nginx.inc;
    }
    server {
    server_name i-manit.ru www.i-manit.ru;
    listen 146.185.163.91;
    disable_symlinks if_not_owner from=$root_path;
    set $root_path /var/www/imanit_tver/data/www/i-manit.ru;
    location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
    root $root_path;
    access_log /var/www/nginx-logs/imanit_tver isp;
    access_log /var/www/httpd-logs/i-manit.ru.access.log;
    error_page 404 = @fallback;
    client_max_body_size 100M;
    client_body_buffer_size 256k;
    }
    location / {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
    proxy_pass 146.185.163.91:81;
    proxy_redirect 146.185.163.91:81/ /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location @fallback {
    proxy_pass 146.185.163.91:81;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    }
    location ^~ /webstat/ {
    auth_basic «Restricted area»;
    auth_basic_user_file /var/www/imanit_tver/data/etc/1969352.passwd;
    try_files $uri @fallback;
    }
    include /usr/local/ispmgr/etc/nginx.inc;
    }
    }

    #mail {
    # # See sample authentication script at:
    # # wiki.nginx.org/ImapAuthenticateWithApachePhpScript
    #
    # # auth_http localhost/auth.php;
    # # pop3_capabilities «TOP» «USER»;
    # # imap_capabilities «IMAP4rev1» «UIDPLUS»;
    #
    # server {
    # listen localhost:110;
    # protocol pop3;
    # proxy on;
    # }
    #
    # server {
    # listen localhost:143;
    # protocol imap;
    # proxy on;
    # }
    #}
    Ответ написан