#180305nginx解析php出现502 Bad的问题

Wesley13
• 阅读 792

问题一

常见502 Bad的问题

[root@localhost ~]# vi /usr/local/nginx/conf/vhost/test.com.conf
将
     50         fastcgi_pass unix:/tmp/php-fcgi.sock;
改错为
     50         fastcgi_pass unix:/tmp/php-cgi.sock;


[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
[root@localhost ~]# tail /usr/local/nginx/logs/nginx_error.log 
2018/03/02 16:07:03 [notice] 7416#0: nginx/1.8.0
2018/03/02 16:07:03 [notice] 7416#0: built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
2018/03/02 16:07:03 [notice] 7416#0: OS: Linux 3.10.0-123.el7.x86_64
2018/03/02 16:07:03 [notice] 7416#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2018/03/02 16:07:03 [notice] 7417#0: start worker processes
2018/03/02 16:07:03 [notice] 7417#0: start worker process 7418
2018/03/02 16:07:03 [notice] 7417#0: start worker process 7419

更改级别

[root@localhost ~]# vi /usr/local/nginx/conf/nginx.conf
将
      3 error_log /usr/local/nginx/logs/nginx_error.log crit;
更改为
      3 error_log /usr/local/nginx/logs/nginx_error.log debug;
为
      1 user nobody nobody;
      2 worker_processes 2;
      3 error_log /usr/local/nginx/logs/nginx_error.log debug;
      4 pid /usr/local/nginx/logs/nginx.pid;
      5 worker_rlimit_nofile 51200;
      6 events
      7 {
      8     use epoll;
      9     worker_connections 6000;
     10 }
     11 http
     12 {
     13     include mime.types;
     14     default_type application/octet-stream;
     15     server_names_hash_bucket_size 3526;
     16     server_names_hash_max_size 4096;
     17     log_format user '$remote_addr $http_x_forwarded_for [$time_local]'
     18     ' $host "$request_uri" $status'
     19     ' "$http_referer" "$http_user_agent"';
     20     sendfile on;
     21     tcp_nopush on;
     22     keepalive_timeout 30;
     23     client_header_timeout 3m;
     24     client_body_timeout 3m;
     25     send_timeout 3m;
     26     connection_pool_size 256;
     27     client_header_buffer_size 1k;
     28     large_client_header_buffers 8 4k;
     29     request_pool_size 4k;
     30     output_buffers 4 32k;
     31     postpone_output 1460;
     32     client_max_body_size 10m;
     33     client_body_buffer_size 256k;
     34     client_body_temp_path /usr/local/nginx/client_body_temp;
     35     proxy_temp_path /usr/local/nginx/proxy_temp;
     36     fastcgi_temp_path /usr/local/nginx/fastcgi_temp;
     37     fastcgi_intercept_errors on;
     38     tcp_nodelay on;
     39     gzip on;
     40     gzip_min_length 1k;
     41     gzip_buffers 4 8k;
     42     gzip_comp_level 5;
     43     gzip_http_version 1.1;
     44     gzip_types text/plain application/x-javascript text/css text/htm
     45     application/xml;
     46     include vhost/*.conf;
     47 }
[root@localhost ~]# /etc/init.d/nginx restart
Restarting nginx (via systemctl):                          [  OK  ]


[root@localhost ~]# vi /usr/local/nginx/conf/nginx.conf
user nobody nobody;
worker_processes 2;
error_log /usr/local/nginx/logs/nginx_error.log debug;
pid /usr/local/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;
events
{
    use epoll;
    worker_connections 6000;
}
http
{
    include mime.types;
    default_type application/octet-stream;
    server_names_hash_bucket_size 3526;
    server_names_hash_max_size 4096;
    log_format user '$remote_addr $http_x_forwarded_for [$time_local]'
    ' $host "$request_uri" $status'
    ' "$http_referer" "$http_user_agent"';
    sendfile on;
    tcp_nopush on;
    keepalive_timeout 30;
    client_header_timeout 3m;
    client_body_timeout 3m;
    send_timeout 3m;
    connection_pool_size 256;
    client_header_buffer_size 1k;
    large_client_header_buffers 8 4k;
    request_pool_size 4k;
    output_buffers 4 32k;
    postpone_output 1460;
    client_max_body_size 10m;
    client_body_buffer_size 256k;
    client_body_temp_path /usr/local/nginx/client_body_temp;
    proxy_temp_path /usr/local/nginx/proxy_temp;
    fastcgi_temp_path /usr/local/nginx/fastcgi_temp;
    fastcgi_intercept_errors on;
    tcp_nodelay on;
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 8k;
    gzip_comp_level 5;
    gzip_http_version 1.1;
    gzip_types text/plain application/x-javascript text/css text/htm
    application/xml;
    include vhost/*.conf;
}

检查

[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
[root@localhost ~]# tail /usr/local/nginx/logs/nginx_error.log 
2018/03/02 16:07:03 [notice] 7416#0: nginx/1.8.0
2018/03/02 16:07:03 [notice] 7416#0: built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
2018/03/02 16:07:03 [notice] 7416#0: OS: Linux 3.10.0-123.el7.x86_64
2018/03/02 16:07:03 [notice] 7416#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2018/03/02 16:07:03 [notice] 7417#0: start worker processes
2018/03/02 16:07:03 [notice] 7417#0: start worker process 7418
2018/03/02 16:07:03 [notice] 7417#0: start worker process 7419
2018/03/02 16:10:08 [notice] 7418#0: *1 "Spider/3.0|YoudaoBot|Tomato" does not match "curl/7.29.0", client: 127.0.0.1, server: test.com, request: "GET HTTP://test.com/test.php HTTP/1.1", host: "test.com"
2018/03/02 16:10:08 [crit] 7418#0: *1 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: test.com, request: "GET HTTP://test.com/test.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "test.com"
2018/03/02 16:10:08 [info] 7418#0: *1 client 127.0.0.1 closed keepalive connection

通过错误信息查询

[root@localhost ~]# ls /tmp/php-cgi.sock
ls: cannot access /tmp/php-cgi.sock: No such file or directory

查询php定义的sock

[root@localhost ~]# cat /usr/local/php-fpm/etc/php-fpm.conf
[global]
pid = /usr/local/php-fpm/var/run/php-fpm.pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
[www]
listen = /tmp/php-fcgi.sock
listen.mode = 666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024

解决方案

[root@localhost ~]# vi /usr/local/nginx/conf/vhost/test.com.conf
将
     50         fastcgi_pass unix:/tmp/php-cgi.sock;
改为
     50         fastcgi_pass unix:/tmp/php-fcgi.sock;


[root@localhost ~]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload
[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php
    正常解析

问题二

[root@localhost ~]# vi /usr/local/php-fpm/etc/php-fpm.conf
注释
      5 listen = /tmp/php-fcgi.sock
为
      5 #listen = /tmp/php-fcgi.sock
添加
      6 listen = 127.0.0.1:9000
为
      1 [global]
      2 pid = /usr/local/php-fpm/var/run/php-fpm.pid
      3 error_log = /usr/local/php-fpm/var/log/php-fpm.log
      4 [www]
      5 #listen = /tmp/php-fcgi.sock
      6 listen = 127.0.0.1:9000
      7 listen.mode = 666
      8 user = php-fpm
      9 group = php-fpm
     10 pm = dynamic
     11 pm.max_children = 50
     12 pm.start_servers = 20
     13 pm.min_spare_servers = 5
     14 pm.max_spare_servers = 35
     15 pm.max_requests = 500
     16 rlimit_files = 1024


[root@localhost ~]# vi /usr/local/php-fpm/etc/php-fpm.conf
[global]
pid = /usr/local/php-fpm/var/run/php-fpm.pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
[www]
#listen = /tmp/php-fcgi.sock
listen = 127.0.0.1:9000
listen.mode = 666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024



[root@localhost ~]# /usr/local/php-fpm/sbin/php-fpm -t
[02-Mar-2018 16:37:48] NOTICE: configuration file /usr/local/php-fpm/etc/php-fpm.conf test is successful
[root@localhost ~]# /etc/init.d/php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm  done

[root@localhost ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2498/master         
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      7484/php-fpm: maste 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7417/nginx: master  
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1287/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      2498/master         
tcp6       0      0 :::3306                 :::*                    LISTEN      2487/mysqld         
tcp6       0      0 :::22                   :::*                    LISTEN      1287/sshd   


[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php 
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
[root@localhost ~]# tail /usr/local/nginx/logs/nginx_error.log 
2018/03/02 16:36:11 [notice] 7462#0: exit
2018/03/02 16:36:12 [notice] 7417#0: signal 17 (SIGCHLD) received
2018/03/02 16:36:12 [notice] 7417#0: worker process 7463 exited with code 0
2018/03/02 16:36:12 [notice] 7417#0: signal 29 (SIGIO) received
2018/03/02 16:36:12 [notice] 7417#0: signal 17 (SIGCHLD) received
2018/03/02 16:36:12 [notice] 7417#0: worker process 7462 exited with code 0
2018/03/02 16:36:12 [notice] 7417#0: signal 29 (SIGIO) received
2018/03/02 16:38:55 [notice] 7474#0: *5 "Spider/3.0|YoudaoBot|Tomato" does not match "curl/7.29.0", client: 127.0.0.1, server: test.com, request: "GET HTTP://test.com/test.php HTTP/1.1", host: "test.com"
2018/03/02 16:38:55 [crit] 7474#0: *5 connect() to unix:/tmp/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: test.com, request: "GET HTTP://test.com/test.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fcgi.sock:", host: "test.com"
2018/03/02 16:38:55 [info] 7474#0: *5 client 127.0.0.1 closed keepalive connection

解决办法

[root@localhost ~]# vi /usr/local/nginx/conf/vhost/test.com.conf 
注释
     48         fastcgi_pass unix:/tmp/php-fcgi.sock;
为
     48 #        fastcgi_pass unix:/tmp/php-fcgi.sock;
添加
     49         fastcgi_pass 127.0.0.1:9000;
为
      1 server
      2 {
      3     listen 80;
      4     server_name test.com test2.com test3.com;
      5     index index.html index.htm index.php;
      6     root /data/wwwroot/test.com;
      7 
      8     if ( $host != 'test.com' ) {
      9         rewrite ^/(.*)$ http://test.com/$1 permanent;
     10     }
     11 
     12     location ~* ^.+\.(gif|jpg|png|swf|flv|rar|zip|doc|pdf|gz|bz2|jpeg|bmp|xls)$
     13     {
     14         expires 7d;
     15         valid_referers none blocked server_names *.test.com;
     16         if ($invalid_referer) {
     17             return 403;
     18         }
     19         access_log off;
     20     }
     21 
     22     location ~ .*\.(js|css)$
     23     {
     24         expires 12h;
     25         access_log off;
     26     }
     27 
     28     location /admin/
     29     {
     30         allow 127.0.0.1;
     31         allow 192.168.81.133;
     32         deny all;
     33     }
     34 
     35     location ~ .*(upload|image)/.*\.php$
     36     {
     37         deny all;
     38     }
     39 
     40     if ($http_user_agent ~* 'Spider/3.0|YoudaoBot|Tomato')
     41     {
     42         return 403;
     43     }
     44 
     45     location ~ \.php$
     46     {
     47         include fastcgi_params;
     48 #        fastcgi_pass unix:/tmp/php-fcgi.sock;
     49         fastcgi_pass 127.0.0.1:9000;
     50         fastcgi_index index.php;
     51         fastcgi_param SCRIPT_FILENAME /data/wwwroot/test.com$fastcgi_script_name;
     52     }
     53     
     54     access_log /tmp/test.com.log user;
     55 }



[root@localhost ~]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload
[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php
    正常解析

问题三

[root@localhost ~]# vi /usr/local/php-fpm/etc/php-fpm.conf
取消注释
      5 #listen = /tmp/php-fcgi.sock
为
      5 listen = /tmp/php-fcgi.sock
注释
      6 #listen = 127.0.0.1:9000
      7 #listen.mode = 666
为
      1 [global]
      2 pid = /usr/local/php-fpm/var/run/php-fpm.pid
      3 error_log = /usr/local/php-fpm/var/log/php-fpm.log
      4 [www]
      5 listen = /tmp/php-fcgi.sock
      6 #listen = 127.0.0.1:9000
      7 #listen.mode = 666
      8 user = php-fpm
      9 group = php-fpm
     10 pm = dynamic
     11 pm.max_children = 50
     12 pm.start_servers = 20
     13 pm.min_spare_servers = 5
     14 pm.max_spare_servers = 35
     15 pm.max_requests = 500
     16 rlimit_files = 1024


[root@localhost ~]# vi /usr/local/php-fpm/etc/php-fpm.conf
[global]
pid = /usr/local/php-fpm/var/run/php-fpm.pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
[www]
listen = /tmp/php-fcgi.sock
#listen = 127.0.0.1:9000
#listen.mode = 666
user = php-fpm 
group = php-fpm 
pm = dynamic 
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024



[root@localhost ~]# /usr/local/php-fpm/sbin/php-fpm -t
[02-Mar-2018 16:55:05] NOTICE: configuration file /usr/local/php-fpm/etc/php-fpm.conf test is successful
[root@localhost ~]# /etc/init.d/php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm  done
[root@localhost ~]# ls -l /tmp/php-fcgi.sock
srw-rw----. 1 root root 0 Mar  2 16:55 /tmp/php-fcgi.sock

这里sock为660,其他用户的权限都是0

取消注释
     48 #       fastcgi_pass unix:/tmp/php-fcgi.sock;
为
     48         fastcgi_pass unix:/tmp/php-fcgi.sock;
注释
     49 #        fastcgi_pass 127.0.0.1:9000;
为
      1 server
      2 {
      3     listen 80;
      4     server_name test.com test2.com test3.com;
      5     index index.html index.htm index.php;
      6     root /data/wwwroot/test.com;
      7 
      8     if ( $host != 'test.com' ) {
      9         rewrite ^/(.*)$ http://test.com/$1 permanent;
     10     }
     11 
     12     location ~* ^.+\.(gif|jpg|png|swf|flv|rar|zip|doc|pdf|gz|bz2|jpeg|bmp|xls)$
     13     {
     14         expires 7d;
     15         valid_referers none blocked server_names *.test.com;
     16         if ($invalid_referer) {
     17             return 403;
     18         }
     19         access_log off;
     20     }
     21 
     22     location ~ .*\.(js|css)$
     23     {
     24         expires 12h;
     25         access_log off;
     26     }
     27 
     28     location /admin/
     29     {
     30         allow 127.0.0.1;
     31         allow 192.168.81.133;
     32         deny all;
     33     }
     34 
     35     location ~ .*(upload|image)/.*\.php$
     36     {
     37         deny all;
     38     }
     39 
     40     if ($http_user_agent ~* 'Spider/3.0|YoudaoBot|Tomato')
     41     {
     42         return 403;
     43     }
     44 
     45     location ~ \.php$
     46     {
     47         include fastcgi_params;
     48         fastcgi_pass unix:/tmp/php-fcgi.sock;
     49 #        fastcgi_pass 127.0.0.1:9000;
     50         fastcgi_index index.php;
     51         fastcgi_param SCRIPT_FILENAME /data/wwwroot/test.com$fastcgi_script_name;
     52     }
     53 
     54     access_log /tmp/test.com.log user;
     55 }



[root@localhost ~]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost ~]# /usr/local/nginx/sbin/nginx -s reload
[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
[root@localhost ~]# tail /usr/local/nginx/logs/nginx_error.log 
2018/03/02 17:00:12 [notice] 7529#0: exit
2018/03/02 17:00:12 [notice] 7530#0: exit
2018/03/02 17:00:12 [notice] 7417#0: signal 17 (SIGCHLD) received
2018/03/02 17:00:12 [notice] 7417#0: worker process 7529 exited with code 0
2018/03/02 17:00:12 [notice] 7417#0: worker process 7530 exited with code 0
2018/03/02 17:00:12 [notice] 7417#0: signal 29 (SIGIO) received
2018/03/02 17:00:12 [notice] 7417#0: signal 17 (SIGCHLD) received
2018/03/02 17:01:33 [notice] 7587#0: *9 "Spider/3.0|YoudaoBot|Tomato" does not match "curl/7.29.0", client: 127.0.0.1, server: test.com, request: "GET HTTP://test.com/test.php HTTP/1.1", host: "test.com"
2018/03/02 17:01:33 [crit] 7587#0: *9 connect() to unix:/tmp/php-fcgi.sock failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: test.com, request: "GET HTTP://test.com/test.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fcgi.sock:", host: "test.com"
2018/03/02 17:01:33 [info] 7587#0: *9 client 127.0.0.1 closed keepalive connection

解决办法

[root@localhost ~]# ps aux | grep nginx
root       7417  0.0  0.0  26124  1780 ?        Ss   16:07   0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody     7587  0.0  0.2  27956  4108 ?        S    17:00   0:00 nginx: worker process
nobody     7588  0.0  0.1  27956  3600 ?        S    17:00   0:00 nginx: worker process
root       7626  0.0  0.0 112664   976 pts/0    S+   17:04   0:00 grep --color=auto nginx
[root@localhost ~]# chown nobody /tmp/php-fcgi.sock
[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php
    正常解析

[root@localhost ~]# vi /usr/local/php-fpm/etc/php-fpm.conf
取消注释
      7 listen.mode = 666
为
      1 [global]
      2 pid = /usr/local/php-fpm/var/run/php-fpm.pid
      3 error_log = /usr/local/php-fpm/var/log/php-fpm.log
      4 [www]
      5 listen = /tmp/php-fcgi.sock
      6 #listen = 127.0.0.1:9000
      7 listen.mode = 666
      8 user = php-fpm
      9 group = php-fpm
     10 pm = dynamic
     11 pm.max_children = 50
     12 pm.start_servers = 20
     13 pm.min_spare_servers = 5
     14 pm.max_spare_servers = 35
     15 pm.max_requests = 500
     16 rlimit_files = 1024
[root@localhost ~]# /etc/init.d/php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm  done
[root@localhost ~]# ls -l /tmp/php-fcgi.sock 
srw-rw-rw-. 1 root root 0 Mar  2 17:13 /tmp/php-fcgi.sock

[root@localhost ~]# curl -x 127.0.0.1:80 test.com/test.php
    正常解析
点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
2年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Wesley13 Wesley13
2年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
2年前
PHP创建多级树型结构
<!lang:php<?php$areaarray(array('id'1,'pid'0,'name''中国'),array('id'5,'pid'0,'name''美国'),array('id'2,'pid'1,'name''吉林'),array('id'4,'pid'2,'n
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这