Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

修改PHP和Nginx文件上传大小限制

php.ini

//post_max_size 的值务必要大于 upload_max_filesize 的值
post_max_size = 8M
upload_max_filesize = 5M

vhost.conf

server {
    listen       80;
    server_name  api.yezhou.me;
    index index.html index.htm index.php;
    root /data/www/HttpApi/public;
    server_name_in_redirect off;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ .+\.php($|/)
    {
        #fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        include       fastcgi.conf;

        fastcgi_split_path_info  ^(.+\.php)(/.*)$;
        fastcgi_param  PATH_INFO $fastcgi_path_info;

        client_max_body_size  5m;  #客户端上传文件大小限制设为5M
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires 30d;
    }
    location ~ .*\.(js|css)?$
    {
        expires 1h;
    }
    #伪静态及日志
    #include /data/server/nginx/conf/rewrite/default.conf;
    access_log /data/server/nginx/logs/api-access.log;
}
nginx -s reload
上一篇 CentOS下安装Git rpm包
下一篇 Nginx location 配置后路径映射问题(路径替换)