nginx,php默认配置填坑

PHP配置:php.ini

  1. json_encode方法浮点精度错误,解决方法:修改:precision = 16

  2. disable_functions = eval,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_set,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,fsocket,fsockopen,error_reporting

  3. date.timezone = Asia/Shanghai

Nginx配置:nginx.conf

  1. fastcgi_buffers 解决cookie或请求响应头超大的502错误 ,
  2. Gzip压缩
http {

...

    # buffers
    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;

...

    # Gzip
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 16 64k;
    gzip_comp_level 6;
    gzip_types text/plain application/javascript text/css application/xml;
    gzip_vary on;

...

转载于:https://my.oschina.net/u/615422/blog/1929640

你可能感兴趣的:(nginx,php默认配置填坑)