Data truncation: Incorrect datetime value: '0000-00-00 00:00:00' for column xxx
Flight-PHP-in-Chinese
Flight PHP 中文版翻译
/**
* 生成MAC
*/
public static function mac_gen()
{
$array = array(
mt_rand(0x00, 0x7f),
mt_rand(0x00, 0x7f),
mt_rand(0x00, 0x7f),
mt_rand(0x00, 0x7f),
mt_rand(0x00, 0xff),
mt_rand(0x00, 0xff)
);
return join(':', array_map(function ($v) {
return sprintf("%02X", $v);
}, $array));
}
每次改 .env 都得通过修改代码来改吗?.env 文件能不能通过在后台配置呢?
其实是很简单就可以实现的,把以下函数加入到你的项目中
Nginx 伪静态
server{
#端口配置
listen 80;
#域名配置
server_name laravel.cc;
index index.php index.html index.htm;
#站点配置到public
root /data/wwwroot/laravel.cc/public;
#日志记录
access_log /data/logs/nginx.laravel.cc.log access;
error_log /data/logs/nginx.laravel.cc.error debug;
#静态文件配置
location ~ .*\.(jpg|jpeg|gif|png|bmp|css|js|swf|txt|ttf|woff|ico)$ {
expires 7d;
break;
}
location / {
#重点区
try_files \$uri \$uri/ /index.php?$query_string;
index index.php index.html index.htm;
}
#静态文件配置
location /logs {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
break;
}
#处理php配置
location ~ "\.php$" {
include fastcgi_params;
fastcgi_index index.php;
#在nginx.conf配置server_mango
fastcgi_pass server_mango;
}
}