質問編集履歴
3
codeの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
mysql:5.6.37 PHP:7.1.10
|
6
6
|
************************************************************
|
7
7
|
|
8
|
-
|
8
|
+
```Error内容
|
9
9
|
[Mon Apr 2 09:15:55 2018] PHP Fatal error: Uncaught Error: Class 'MyApp\Controller\Index' not found in /home/vagrant/sns_php/public_html/index.php:9
|
10
10
|
Stack trace:
|
11
11
|
#0 {main}
|
@@ -14,10 +14,12 @@
|
|
14
14
|
Stack trace:
|
15
15
|
#0 {main}
|
16
16
|
thrown in /home/vagrant/sns_php/public_html/index.php on line 9
|
17
|
-
|
17
|
+
```
|
18
18
|
|
19
|
-
```index。php
|
20
19
|
|
20
|
+
|
21
|
+
```public_html/index。php
|
22
|
+
|
21
23
|
<?php
|
22
24
|
|
23
25
|
// ユーザーの一覧
|
@@ -75,6 +77,27 @@
|
|
75
77
|
session_start();
|
76
78
|
|
77
79
|
```
|
80
|
+
```Controller/index.php
|
81
|
+
<?php
|
82
|
+
|
83
|
+
namespace MyApp\Controller;
|
84
|
+
|
85
|
+
class Index extends \MyApp\Controller {
|
86
|
+
|
87
|
+
public function run() {
|
88
|
+
if (!$this->isLoggedIn()) {
|
89
|
+
// login
|
90
|
+
header('Location: ' . SITE_URL . '/login.php');
|
91
|
+
exit;
|
92
|
+
}
|
93
|
+
|
94
|
+
// get users info
|
95
|
+
$userModel = new \MyApp\Model\User();
|
96
|
+
$this->setValues('users', $userModel->findAll());
|
97
|
+
}
|
98
|
+
|
99
|
+
}
|
100
|
+
```
|
78
101
|

|
79
102
|
|
80
103
|

|
2
画像を追加しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -77,4 +77,6 @@
|
|
77
77
|
```
|
78
78
|

|
79
79
|
|
80
|
+

|
81
|
+
|
80
82
|
よろしくご指導下さい
|
1
コードの追加をする
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,8 +3,9 @@
|
|
3
3
|
PHPでログイン機能を実装しよう https://dotinstall.com/lessons/sns_php_v3/35826
|
4
4
|
これの23章目ぐらいからUncaught Errorが出てしまい正しくブラウザ表示がしないです
|
5
5
|
mysql:5.6.37 PHP:7.1.10
|
6
|
-
************************************************************
|
6
|
+
************************************************************
|
7
|
+
|
7
|
-
|
8
|
+
''''
|
8
9
|
[Mon Apr 2 09:15:55 2018] PHP Fatal error: Uncaught Error: Class 'MyApp\Controller\Index' not found in /home/vagrant/sns_php/public_html/index.php:9
|
9
10
|
Stack trace:
|
10
11
|
#0 {main}
|
@@ -13,9 +14,10 @@
|
|
13
14
|
Stack trace:
|
14
15
|
#0 {main}
|
15
16
|
thrown in /home/vagrant/sns_php/public_html/index.php on line 9
|
16
|
-
|
17
|
+
''''
|
18
|
+
|
17
|
-
index
|
19
|
+
```index。php
|
18
|
-
|
20
|
+
|
19
21
|
<?php
|
20
22
|
|
21
23
|
// ユーザーの一覧
|
@@ -56,6 +58,23 @@
|
|
56
58
|
</html>
|
57
59
|
|
58
60
|
```
|
61
|
+
```config.php
|
62
|
+
<?php
|
63
|
+
|
64
|
+
ini_set('display_errors', 1);
|
65
|
+
|
66
|
+
define('DSN', 'mysql:dbhost=localhost;dbname=dotinstall_sns_php');
|
67
|
+
define('DB_USERNAME', 'dbuser');
|
68
|
+
define('DB_PASSWORD', 'muku1130');
|
69
|
+
|
70
|
+
define('SITE_URL', 'http://' . $_SERVER['HTTP_HOST']);
|
71
|
+
|
72
|
+
require_once(__DIR__ . '/../lib/functions.php');
|
73
|
+
require_once(__DIR__ . '/autoload.php');
|
74
|
+
|
75
|
+
session_start();
|
76
|
+
|
77
|
+
```
|
59
78
|

|
60
79
|
|
61
80
|
よろしくご指導下さい
|