我知道这个问题已经讨论,解决或关闭了.
但我想问的是,为什么数字191?
Schema::defaultStringLength(191);
Run Code Online (Sandbox Code Playgroud)
我试过:如果192,错了.191,好的.在此之后,我还编辑了database\migrations\xxx_user_table.php
更改此设置
$table->string('name');
Run Code Online (Sandbox Code Playgroud)
成为
$table->string('name', 255);
Run Code Online (Sandbox Code Playgroud)
然后运行php artisan migrate,没关系.使用一些mysql工具查看用户表的模式,varchar的名称长度实际为255,其他列为191.
我看到这些文章
@ https://laravel-news.com/laravel-5-4-key-too-long-error
@ Laravel迁移:唯一密钥太长,即使指定
@ https://github.com/ laravel/framework/issues/17508
@ https://laravel.com/docs/master/migrations#creating-indexes
这个:@ https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html
对于使用REDUNDANT或COMPACT行格式的InnoDB表,索引键前缀长度限制为767字节.例如,您可能会在TEXT或VARCHAR列上使用超过255个字符的列前缀索引达到此限制,假设为utf8mb3字符集,并且每个字符最多包含3个字节.
但为什么长度255的名字还可以?
并且192*3 = 576,小于767,为什么192不行?
Windows 10、Apache httpd 2.4、PHP 7.1.4、Laravel 5.5
Gmail 的安全性较低是允许的。
我的 .env 文件:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=account@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
Run Code Online (Sandbox Code Playgroud)
错误信息:
无法与主机 smtp.gmail.com 建立连接
MAIL_PORT=587
MAIL_ENCRYPTION=tls
Run Code Online (Sandbox Code Playgroud)
错误信息:
Stream_socket_enable_crypto():SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:14090086:SSL 例程:ssl3_get_server_certificate:证书验证失败
如何解决“证书验证失败”错误?
我使用 docker,通过 Sail 安装了 Laravel 9。
我想知道它使用 Apache 还是 Nginx?
哪个文件/行将公用文件夹设置为文档根目录?
阿帕奇和 PHP
三个站点
httpd-vhosts.conf
AddType application/x-httpd-php .php
ScriptAlias /php-7.1.4/ "D:/webserver/php/php-7.1.4-Win32-VC14-x64/"
ScriptAlias /php-7.0.18/ "D:/webserver/php/php-7.0.18-Win32-VC14-x64/"
ScriptAlias /php-5.6.30/ "D:/webserver/php/php-5.6.30-Win32-VC11-x64/"
<Directory "D:/webserver/php">
Order allow,deny
Allow from all
Require all granted
</Directory>
<Directory "D:/wwwroot">
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:\wwwroot\tests\php56"
ServerName php56.local
ErrorLog "logs/php56-error.log"
CustomLog "logs/php56-access.log" common
<Directory "D:\wwwroot\tests\php56">
Action application/x-httpd-php "/php-5.6.30/php-cgi.exe"
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot …Run Code Online (Sandbox Code Playgroud) 我没有特定的工作要做,只是想知道each()可以做什么。我用谷歌搜索,看到了这篇文章:https : //github.com/laravel/framework/issues/1380
它说
每个对象都可以对所有项目执行某些操作,这就是所有内容,而这就是每个对象已经在执行的操作。
有什么操作?
我有一个二维数组.在for循环中,我想这样做
procedure TForm1.Button2Click(Sender: TObject);
var i : integer;
arr : array[0..2, 0..1] of integer;
tmpArr : array[0..1] of integer;
begin
arr[0, 0] := 0;
arr[0, 1] := 92;
arr[1, 0] := 1;
arr[1, 1] := 75;
arr[2, 0] := 2;
arr[2, 1] := 70;
for i := 0 to 2 do
tmpArr := arr[i];
end;
Run Code Online (Sandbox Code Playgroud)
但它说不兼容的类型.我认为arr [i]和tmpArr都是一维数组,每个都有两个元素,不是吗?