質問編集履歴

2

微修正

2016/12/13 09:36

投稿

makura
makura

スコア8

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,13 @@
1
+ ###前提
2
+
3
+ cakephpでweb serviceを作っていたのですが、ローカル開発環境のデータがなくなってしまい、
4
+
5
+ githubからcloneしてきたソースコードを元に、再びローカル環境を構築しようといています。
6
+
7
+
8
+
9
+
10
+
1
11
  ###発生している問題・エラーメッセージ
2
12
 
3
13
  httpd.confをいじってサイトが表示されるところまではきたのですが、

1

該当ソースをphp\.ini -> top画面のhtml に変更しました。

2016/12/13 09:36

投稿

makura
makura

スコア8

test CHANGED
File without changes
test CHANGED
@@ -1,15 +1,3 @@
1
- ###前提・実現したいこと
2
-
3
- 初めましてmakuraと申します。
4
-
5
- cakephpでweb serviceを作っていたのですが、ローカル開発環境のデータがなくなってしまい、
6
-
7
- githubからcloneしてきたソースコードを元に、再びローカル環境を構築しようといています。
8
-
9
-
10
-
11
-
12
-
13
1
  ###発生している問題・エラーメッセージ
14
2
 
15
3
  httpd.confをいじってサイトが表示されるところまではきたのですが、
@@ -30,245 +18,219 @@
30
18
 
31
19
 
32
20
 
33
- [php.ini]
21
+
34
22
 
35
23
  ###該当のソースコード
36
24
 
37
- ```php.ini
38
-
39
- <?php
40
-
41
- /**
42
-
43
- * The Front Controller for handling every request
44
-
45
- *
46
-
47
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
48
-
49
- * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
50
-
51
- *
52
-
53
- * Licensed under The MIT License
54
-
55
- * For full copyright and license information, please see the LICENSE.txt
56
-
57
- * Redistributions of files must retain the above copyright notice.
58
-
59
- *
60
-
61
- * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
62
-
63
- * @link http://cakephp.org CakePHP(tm) Project
64
-
65
- * @package app.webroot
66
-
67
- * @since CakePHP(tm) v 0.2.9
68
-
69
- * @license http://www.opensource.org/licenses/mit-license.php MIT License
70
-
71
- */
72
-
73
-
74
-
75
- /**
76
-
77
- * Use the DS to separate the directories in other defines
78
-
79
- */
80
-
81
- if (!defined('DS')) {
82
-
83
- define('DS', DIRECTORY_SEPARATOR);
84
-
85
- }
86
-
87
-
88
-
89
- /**
90
-
91
- * These defines should only be edited if you have CakePHP installed in
92
-
93
- * a directory layout other than the way it is distributed.
94
-
95
- * When using custom settings be sure to use the DS and do not add a trailing DS.
96
-
97
- */
98
-
99
-
100
-
101
- /**
102
-
103
- * The full path to the directory which holds "app", WITHOUT a trailing DS.
104
-
105
- */
106
-
107
- if (!defined('ROOT')) {
108
-
109
- define('ROOT', dirname(dirname(dirname(__FILE__))));
110
-
111
- }
112
-
113
-
114
-
115
- /**
116
-
117
- * The actual directory name for the "app".
118
-
119
- */
120
-
121
- if (!defined('APP_DIR')) {
122
-
123
- define('APP_DIR', basename(dirname(dirname(__FILE__))));
124
-
125
- }
126
-
127
-
128
-
129
- /**
130
-
131
- * The absolute path to the "cake" directory, WITHOUT a trailing DS.
132
-
133
- *
134
-
135
- * Un-comment this line to specify a fixed path to CakePHP.
136
-
137
- * This should point at the directory containing `Cake`.
138
-
139
- *
140
-
141
- * For ease of development CakePHP uses PHP's include_path. If you
142
-
143
- * cannot modify your include_path set this value.
144
-
145
- *
146
-
147
- * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
148
-
149
- *
150
-
151
- * The following line differs from its sibling
152
-
153
- * /app/webroot/index.php
154
-
155
- */
156
-
157
- define(
158
-
159
- 'CAKE_CORE_INCLUDE_PATH',
160
-
161
- ROOT . DS . 'vendors' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib'
162
-
163
- );
164
-
165
-
166
-
167
- /**
168
-
169
- * This auto-detects CakePHP as a composer installed library.
170
-
171
- * You may remove this if you are not planning to use composer (not recommended, though).
172
-
173
- */
174
-
175
- $vendorPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
176
-
177
- $dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
178
-
179
- if (!defined('CAKE_CORE_INCLUDE_PATH') && file_exists($vendorPath . DS . $dispatcher)) {
180
-
181
- define('CAKE_CORE_INCLUDE_PATH', $vendorPath);
182
-
183
- }
184
-
185
-
186
-
187
- /**
188
-
189
- * Editing below this line should NOT be necessary.
190
-
191
- * Change at your own risk.
192
-
193
- */
194
-
195
- if (!defined('WEBROOT_DIR')) {
196
-
197
- define('WEBROOT_DIR', basename(dirname(__FILE__)));
198
-
199
- }
200
-
201
- if (!defined('WWW_ROOT')) {
202
-
203
- define('WWW_ROOT', dirname(__FILE__) . DS);
204
-
205
- }
206
-
207
-
208
-
209
- // For the built-in server
210
-
211
- if (PHP_SAPI === 'cli-server') {
212
-
213
- if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) {
214
-
215
- return false;
216
-
217
- }
218
-
219
- $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
220
-
221
- }
222
-
223
-
224
-
225
- if (!defined('CAKE_CORE_INCLUDE_PATH')) {
226
-
227
- if (function_exists('ini_set')) {
228
-
229
- ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
230
-
231
- }
232
-
233
- if (!include 'Cake' . DS . 'bootstrap.php') {
234
-
235
- $failed = true;
236
-
237
- }
238
-
239
- } elseif (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
240
-
241
- $failed = true;
242
-
243
- }
244
-
245
- if (!empty($failed)) {
246
-
247
- trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
248
-
249
- }
250
-
251
-
252
-
253
- App::uses('Dispatcher', 'Routing');
254
-
255
-
256
-
257
- $Dispatcher = new Dispatcher();
258
-
259
- $Dispatcher->dispatch(
260
-
261
- new CakeRequest(),
262
-
263
- new CakeResponse()
264
-
265
- );
266
-
267
-
25
+
26
+
27
+ [TOP画面のソースを表示]
268
28
 
269
29
  ```
270
30
 
271
-
31
+ <!DOCTYPE html>
32
+
33
+ <html>
34
+
35
+ <head>
36
+
37
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>
38
+
39
+ うついったー
40
+
41
+ </title>
42
+
43
+ <link href="/favicon.ico" type="image/x-icon" rel="icon"/><link href="/favicon.ico" type="image/x-icon" rel="shortcut icon"/><link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css"/><link rel="stylesheet" type="text/css" href="/css/style.css"/> <meta name="viewport" content="width=device-width">
44
+
45
+ <style>
46
+
47
+ body {
48
+
49
+ padding-top: 70px;
50
+
51
+ }
52
+
53
+ </style>
54
+
55
+ </head>
56
+
57
+ <body>
58
+
59
+ <div id="wrap">
60
+
61
+ <div class="navbar navbar-default navbar-fixed-top" role="navigation">
62
+
63
+ <div class="container">
64
+
65
+ <div class="navbar-header">
66
+
67
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
68
+
69
+ <span class="glyphicon glyphicon-align-justify"></span>
70
+
71
+ </button>
72
+
73
+ <a href="/" class="navbar-brand">うついったー</a> </div>
74
+
75
+ <div class="navbar-collapse collapse">
76
+
77
+ <ul class="nav navbar-nav navbar-right">
78
+
79
+ <li><a href="/users/login">Login</a></li>
80
+
81
+ </ul>
82
+
83
+ </div><!--/.nav-collapse -->
84
+
85
+ <div class="modal" id="post-modal">
86
+
87
+ <div class="modal-dialog post-modal-dialog">
88
+
89
+ <div class="modal-content">
90
+
91
+ <div class="modal-body">
92
+
93
+ <button type="button" class="close" data-dismiss="modal">×</button>
94
+
95
+ <!DOCTYPE html>
96
+
97
+ <html>
98
+
99
+ <head>
100
+
101
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>
102
+
103
+ うついったー
104
+
105
+ </title>
106
+
107
+ <link href="/favicon.ico" type="image/x-icon" rel="icon"/><link href="/favicon.ico" type="image/x-icon" rel="shortcut icon"/><link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css"/><link rel="stylesheet" type="text/css" href="/css/style.css"/> <meta name="viewport" content="width=device-width">
108
+
109
+ <style>
110
+
111
+ body {
112
+
113
+ padding-top: 70px;
114
+
115
+ }
116
+
117
+ </style>
118
+
119
+ </head>
120
+
121
+ <body>
122
+
123
+ <div id="wrap">
124
+
125
+ <div class="navbar navbar-default navbar-fixed-top" role="navigation">
126
+
127
+ <div class="container">
128
+
129
+ <div class="navbar-header">
130
+
131
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
132
+
133
+ <span class="glyphicon glyphicon-align-justify"></span>
134
+
135
+ </button>
136
+
137
+ <a href="/" class="navbar-brand">うついったー</a> </div>
138
+
139
+ <div class="navbar-collapse collapse">
140
+
141
+ <ul class="nav navbar-nav navbar-right">
142
+
143
+ <li><a href="/users/login">Login</a></li>
144
+
145
+ </ul>
146
+
147
+ </div><!--/.nav-collapse -->
148
+
149
+ <div class="modal" id="post-modal">
150
+
151
+ <div class="modal-dialog post-modal-dialog">
152
+
153
+ <div class="modal-content">
154
+
155
+ <div class="modal-body">
156
+
157
+ <button type="button" class="close" data-dismiss="modal">×</button>
158
+
159
+ <!DOCTYPE html>
160
+
161
+ <html>
162
+
163
+ <head>
164
+
165
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>
166
+
167
+ CakePHP: the rapid development php framework:
168
+
169
+ Errors </title>
170
+
171
+ <link href="/favicon.ico" type="image/x-icon" rel="icon"/><link href="/favicon.ico" type="image/x-icon" rel="shortcut icon"/><link rel="stylesheet" type="text/css" href="/css/cake.generic.css"/></head>
172
+
173
+ <body>
174
+
175
+ <div id="container">
176
+
177
+ <div id="header">
178
+
179
+ <h1><a href="http://cakephp.org">CakePHP: the rapid development php framework</a></h1>
180
+
181
+ </div>
182
+
183
+ <div id="content">
184
+
185
+
186
+
187
+
188
+
189
+ <h2>SQLSTATE[HY000] [2002] Operation timed out</h2>
190
+
191
+ <p class="error">
192
+
193
+ <strong>Error: </strong>
194
+
195
+ An Internal Error Has Occurred.</p>
196
+
197
+ <h3>Stack Trace</h3>
198
+
199
+ <ul class="cake-stack-trace">
200
+
201
+ <li><a href="#" onclick="traceToggle(event, 'file-excerpt-0')">CORE/Cake/Model/Datasource/DboSource.php line 260</a> &rarr; <a href="#" onclick="traceToggle(event, 'trace-args-0')">Mysql->connect()</a> <div id="file-excerpt-0" class="cake-code-dump" style="display:none;"><pre><code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">));</span></span></code>
202
+
203
+ <code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}</span></span></code>
204
+
205
+ <code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$autoConnect</span><span style="color: #007700">)&nbsp;{</span></span></code>
206
+
207
+ <span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">();</span></span></code></span>
208
+
209
+ <code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}</span></span></code></pre></div> <div id="trace-args-0" class="cake-code-dump" style="display: none;"><pre></pre></div></li>
210
+
211
+ <li><a href="#" onclick="traceToggle(event, 'file-excerpt-1')">CORE/Cake/Model/ConnectionManager.php line 105</a> &rarr; <a href="#" onclick="traceToggle(event, 'trace-args-1')">DboSource->__construct(array)</a> <div id="file-excerpt-1" class="cake-code-dump" style="display:none;"><pre><code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'message'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'Datasource&nbsp;is&nbsp;not&nbsp;found&nbsp;in&nbsp;Model/Datasource&nbsp;package.'</span></span></code>
212
+
213
+ <code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">));</span></span></code>
214
+
215
+ <code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}</span></span></code>
216
+
217
+ <span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">static::</span><span style="color: #0000BB">$_dataSources</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]&nbsp;=&nbsp;new&nbsp;</span><span style="color: #0000BB">$class</span><span style="color: #007700">(static::</span><span style="color: #0000BB">$config</span><span style="color: #007700">-&gt;{</span><span style="color: #0000BB">$name</span><span style="color: #007700">});</span></span></code></span>
218
+
219
+ <code><span style="color: #000000"><span style="color: #0000BB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">static::</span><span style="color: #0000BB">$_dataSources</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]-&gt;</span><span style="color: #0000BB">configKeyName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">;</span></span></code></pre></div> <div id="trace-args-1" class="cake-code-dump" style="display: none;"><pre>array(
220
+
221
+ &#039;password&#039; =&gt; &#039;*****&#039;,
222
+
223
+ &#039;login&#039; =&gt; &#039;*****&#039;,
224
+
225
+ &#039;host&#039; =&gt; &#039;*****&#039;,
226
+
227
+ &#039;database&#039; =&gt; &#039;*****&#039;,
228
+
229
+
230
+
231
+ 以下省略
232
+
233
+ ```
272
234
 
273
235
  ###試したこと
274
236