Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress Nginx 1.4.6.503错误_Wordpress_Nginx_Laravel 4_Digital Ocean - Fatal编程技术网

Wordpress Nginx 1.4.6.503错误

Wordpress Nginx 1.4.6.503错误,wordpress,nginx,laravel-4,digital-ocean,Wordpress,Nginx,Laravel 4,Digital Ocean,Nginx 1.4.6.503错误 我在digitalocean droplet-nginx/1.4.6(Ubuntu)上配置了两个网站(wordpress和LaravelV4) 这两个网站通常工作得非常好和迅速 但在laravel网站保存任何数据时,都会抛出503错误。 在wordpress中,它不会彻底消除503错误,但在保存任何帖子或任何数据时,需要很长时间才能在1-3分钟左右做出响应 两个站点的虚拟主机配置如下所示 server { listen 80;

Nginx 1.4.6.503错误

我在digitalocean droplet-nginx/1.4.6(Ubuntu)上配置了两个网站(wordpress和LaravelV4)

这两个网站通常工作得非常好和迅速

但在laravel网站保存任何数据时,都会抛出503错误。 在wordpress中,它不会彻底消除503错误,但在保存任何帖子或任何数据时,需要很长时间才能在1-3分钟左右做出响应

两个站点的虚拟主机配置如下所示

server {
        listen 80;

        listen 443 ssl;

        root /var/www/domain1.com/public_html;

        index index.php index.html index.htm;

        ssl_certificate /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /etc/nginx/ssl/nginx.key;

        # Make site accessible from http://localhost/
        server_name domain1.com www.domain1.com;


        access_log off;

        #GZIP Configuration
        gzip on;
        gzip_min_length 100;
        gzip_comp_level 3;

        gzip_types text/plain;
        gzip_types text/css;
        gzip_types text/javascript;

        gzip_disable "msie6";



        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
                if ($host !~* ^www\.)
                {
                        rewrite  ^/(.*)$  http://www.$host/$1  permanent;
                }
                proxy_read_timeout 300;
        }


        error_page 404 /error.html;


        location ^~ /error.html {
                rewrite ^/.* http://www.domain1.com permanent;
        }


        location ~* \.(css|js|jpg|png|gif)$ {
                access_log off;
                expires 1M;
                add_header Pragma public;
                add_header Cache-Control public;
                add_header Vary Accept-Encoding;
        }


        try_files $uri $uri/ @rewrite;

        location @rewrite {
               rewrite ^/(.*)$ /index.php?_url=/$1;
        }


        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_read_timeout 600s;
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;

                fastcgi_param PATH_INFO    $fastcgi_path_info;


                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

}
我还检查了错误日志,没有发现任何关键问题


请告诉我,为什么Laravel v4网站显示503个错误,为什么wordpress网站在保存数据时速度慢。

503表示服务没有响应。我猜你是因为laraval使用了太多的资源,例如内存,可能是你的液滴最大化而超时

从您的配置中,我可以看到您有一个php fpm套接字,但决定通过端口9000使用php

#fastcgi\u pass unix:/var/run/php5-fpm.sock

fastcgi_pass 127.0.0.1:9000

我建议将php fpm配置为两个不同的池,一个用于wordpress,另一个用于laravel,然后将它们设置为侦听每个池具有不同设置的不同套接字,即wordpress可以具有
php_值[内存限制]=128M
和laravel
php_值[内存限制]=64M
。虽然这只是一个想法,因为每个游泳池都有很多设置

此外,您的配置具有非常丰富的超时设置:

代理读取超时300

fastcgi\u读取\u超时600秒

等待5到10分钟等待响应是非常不寻常的

我认为最好的办法是:

  • 使用php fpm和不同的套接字->每个站点的自定义设置
  • 安装它的基本水平是免费的,这将 让您了解服务器的运行情况。i、 e.内存使用,如何使用 执行一个请求需要很长时间。希望它能帮助你 查找代码中的问题,即为什么需要花费这么长时间 laravel保存数据
  • 更改超时,即将其降低5到10分钟是疯狂的
  • 根据您的发现,可能会升级您的液滴
  • 关于如何调整php fpm和nginx的好网站

感谢您宝贵的回答。我对服务器知之甚少,我知道可以在php.ini中定义
php\u值[memory\u limit]
,但我认为这是全局性的。因此,请您指导我在哪里可以为两个站点定义不同的值。php值[内存限制]实际上是每个池的设置。您考虑的是php.ini中的内存限制,它是全局的。因此,您有一个全局设置和一个特定于池的设置。您是否检查了该链接?它提供了一些关于php Fpm(和Nginx)池设置的有价值的提示,即子项数量、请求数量等。您是否尝试过使用newrelic?