php - PHP 杠杆 FatalErrorException
问题描述
我正在学习 php 杠杆。我想将记录插入 mysql 数据库。一段时间后,我收到以下错误。
(1/1) FatalErrorException 在 HandleExceptions.php 第 57 行中超过了 60 秒的最大执行时间
这是控制器的代码。
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class StudInsertController extends Controller {
public function insertform() {
return view('stud_create');
}
public function insert(Request $request) {
$name = $request->input('stud_name');
DB::insert('insert into student (name) values(?)',[$name]);
echo "Record inserted successfully.<br/>";
echo '<a href = "/insert">Click Here</a> to go back.';
}
}
这是html代码。
<html>
<head>
<title>Student Management | Add</title>
</head>
<body>
<form action = "/create" method = "post">
<input type = "hidden" name = "_token" value = "<?php echo csrf_token(); ?>">
<table>
<tr>
<td>Name</td>
<td><input type='text' name='stud_name' /></td>
</tr>
<tr>
<td colspan = '2'>
<input type = 'submit' value = "Add student"/>
</td>
</tr>
</table>
</form>
</body>
</html>
这是路线..
Route::get('insert','StudInsertController@insertform');
Route::post('create','StudInsertController@insert');
我还尝试更改 php.ini-development 文件中的限制
Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 300
解决方案
推荐阅读
- node.js - 使用 React Web 应用程序的 SSO
- java - 矩形不更新也不显示颜色
- naming - 命令中布尔参数的命名
- yii2 - Yii2:为gridview添加数据选择器
- amazon-redshift - 为什么不使用带有交错排序键的时间戳?
- android - 用于检查 SPEN 是否附加在手机中的 API?
- gitlab - 使用共享运行器的 GitLab CI/CD 配置问题
- android - 转包在一个 Java 对象中出错警告(使用 safeUnbox 方法)
- javascript - jQuery Keypad / Primefaces 键盘重新映射空格键
- c# - 如何在 C# 中使用 Directory.GetFiles() 添加多个文件?