質問編集履歴

3

curl.phpのデバッグ結果を追加しました。

2015/05/27 01:32

投稿

usugita_san
usugita_san

スコア226

test CHANGED
File without changes
test CHANGED
@@ -101,3 +101,61 @@
101
101
  404エラーとなっていたのは例外処理の結果らしく、根本的にはこのset_responseあたりに問題があるんじゃないかと思っています。
102
102
 
103
103
  引き続き調べてみます。
104
+
105
+
106
+
107
+
108
+
109
+ さらに追記です。
110
+
111
+
112
+
113
+ curl.php の executeメソッドで、
114
+
115
+
116
+
117
+ ```lang-php
118
+
119
+ $body = curl_exec($connection);
120
+
121
+ ```
122
+
123
+
124
+
125
+ の結果、$bodyが空になっていました。
126
+
127
+
128
+
129
+ その数行手前で、
130
+
131
+
132
+
133
+ ```lang-php
134
+
135
+ curl_setopt_array($connection, $this->options);
136
+
137
+ ```
138
+
139
+ の時点で、$this->options の内容をログに出力した所、以下のようになりました。
140
+
141
+
142
+
143
+ > (
144
+
145
+ > [> 64] =>
146
+
147
+ > [13] => 30
148
+
149
+ > [19913] => 1
150
+
151
+ > [45] =>
152
+
153
+ > [52] => 1
154
+
155
+ > [10036] => POST
156
+
157
+ > [47] => 1
158
+
159
+ > [10015] => param_name=hogehoge1&param_name2=hogehoge2
160
+
161
+ > )

2

404エラーは、例外処理の結果だという事が分かりましたので、追記しました。

2015/05/27 01:32

投稿

usugita_san
usugita_san

スコア226

test CHANGED
File without changes
test CHANGED
@@ -63,3 +63,41 @@
63
63
  curlをコマンドで打つとリクエストが届くので、セキュリティグループの問題ではないと考えています。
64
64
 
65
65
  FuelPHPの内部的な問題ではないかと思っていますが、configファイルは数週間変更しておりません。
66
+
67
+
68
+
69
+ 追記です。
70
+
71
+ Fuel\Core\classes\requestのcurl.phpで、executeメソッドの中を見てみると、
72
+
73
+ ```lang-php
74
+
75
+ $this->set_response($body, $this->response_info('http_code', 200), $mime, $headers, isset($this->headers['Accept']) ? $this->headers['Accept'] : null);
76
+
77
+ ```
78
+
79
+ という処理の後で、
80
+
81
+
82
+
83
+ ```lang-php
84
+
85
+ if ($body === false)
86
+
87
+ {
88
+
89
+ $this->set_defaults();
90
+
91
+ throw new \RequestException(curl_error($connection), curl_errno($connection));
92
+
93
+ }
94
+
95
+ ```
96
+
97
+
98
+
99
+ の処理に入ってました。
100
+
101
+ 404エラーとなっていたのは例外処理の結果らしく、根本的にはこのset_responseあたりに問題があるんじゃないかと思っています。
102
+
103
+ 引き続き調べてみます。

1

httpをhttpsに変更しました。

2015/05/27 01:18

投稿

usugita_san
usugita_san

スコア226

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  ```lang-php
12
12
 
13
- $url = "http://hogehoge.net/hoge/api/login"
13
+ $url = "https://hogehoge.net/hoge/api/login"
14
14
 
15
15
  $request = \Request::forge($url, 'curl');
16
16
 
@@ -36,7 +36,7 @@
36
36
 
37
37
 
38
38
 
39
- > INFO - 2015-05-26 10:06:34 --> Fuel\Core\Request_Curl::__construct - Creating a new CURL Request with URI = "http://hogehoge.net/hoge/api/login"
39
+ > INFO - 2015-05-26 10:06:34 --> Fuel\Core\Request_Curl::__construct - Creating a new CURL Request with URI = "https://hogehoge.net/hoge/api/login"
40
40
 
41
41
  > INFO - 2015-05-26 10:06:34 --> Fuel\Core\Request::__construct - Creating a new main Request with URI = "error/404"
42
42