ejabberd - Comments for "mod_rest on ejabberd 15.0.4 on MAC OS X yosemite is not starting" https://www.ejabberd.im/node/24955 en Now the it give error https://www.ejabberd.im/node/24955#comment-65869 <p>Now the it give error message Try POSTing a stanza. my php code is below:-</p> <div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$request </span><span style="color: #007700">= </span><span style="color: #DD0000">"&lt;message from='mayank@mydomian.org'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to='manoj@mydomian.org'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type='chat'&gt;<br />&nbsp; &lt;body&gt;this message is send by php script &lt;/body&gt;<br />&lt;/message&gt;"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$params</span><span style="color: #007700">=</span><span style="color: #DD0000">"data=</span><span style="color: #0000BB">$request</span><span style="color: #DD0000">&amp;host=mydomain.org&amp;ip=192.168.1.11&amp;method=POST"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$stream </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://memory'</span><span style="color: #007700">,</span><span style="color: #DD0000">'r+'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</span><span style="color: #007700">, </span><span style="color: #0000BB">$params</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">rewind</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</span><span style="color: #007700">);<br />&nbsp; <br />&nbsp;&nbsp; </span><span style="color: #0000BB">$url </span><span style="color: #007700">= </span><span style="color: #DD0000">"http://mydomain.org:5285/rest"</span><span style="color: #007700">;<br />&nbsp;&nbsp; </span><span style="color: #0000BB">$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #0000BB">$url</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">, </span><span style="color: #0000BB">stream_get_contents</span><span style="color: #007700">(</span><span style="color: #0000BB">$stream</span><span style="color: #007700">));<br />&nbsp; echo </span><span style="color: #0000BB">$response </span><span style="color: #007700">= </span><span style="color: #0000BB">stream_get_contents</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br />&nbsp; <br /></span><span style="color: #0000BB">?&gt;</span></span></code></div> <p>Please suggest me a solution!</p> Thu, 25 Jun 2015 15:39:17 +0000 sunil.kumar comment 65869 at https://www.ejabberd.im Ok, so the previous problem https://www.ejabberd.im/node/24955#comment-65867 <p>Ok, so the previous problem was caused by what I said. And now you are facing a different one: apparently mod_rest got compiled with some option (the default one probably) to use p1_logger, which apparently is not included with your ejabberd installation.</p> <p>I can't provide some specific solution, so I recommend you:<br /> ejabberd 15.06 is almost ready to be released. When available, install it, then install mod_rest using the recommended method:</p> <p>ejabberdctl modules_update_specs<br /> ejabberdctl module_install mod_rest</p> <p>And let's hope that solves the problem.</p> Thu, 25 Jun 2015 09:37:13 +0000 badlop comment 65867 at https://www.ejabberd.im Your build / install is https://www.ejabberd.im/node/24955#comment-65864 <p>Your build / install is incorrect, as shown by undefined module errors.</p> Thu, 25 Jun 2015 08:32:10 +0000 mremond comment 65864 at https://www.ejabberd.im I am doing the same, whenever https://www.ejabberd.im/node/24955#comment-65860 <p>I am doing the same, whenever I excute this command on terminal $&gt; curl -v localhost:5285/rest :<br /> display below the crash log.</p> <h3>crash.log</h3> <div class="codeblock"><code>2015-06-24 18:57:01.424 [info] &lt;0.444.0&gt;@ejabberd_listener:accept:304 (#Port&lt;0.3966&gt;) Accepted connection 127.0.0.1:55108 -&gt; 127.0.0.1:5285<br />2015-06-24 18:57:01.425 [info] &lt;0.568.0&gt;@ejabberd_http:init:155 started: {gen_tcp,#Port&lt;0.3966&gt;}<br />2015-06-24 18:57:01.432 [error] &lt;0.568.0&gt; CRASH REPORT Process &lt;0.568.0&gt; with 0 neighbours crashed with reason: call to undefined function p1_logger:debug_msg(mod_rest, 60, &quot;Got request to ~p: ~p&quot;, [[],{request,&#039;GET&#039;,[&lt;&lt;&quot;rest&quot;&gt;&gt;],[{nokey,&lt;&lt;&gt;&gt;}],{&lt;&lt;&gt;&gt;,&lt;&lt;&gt;&gt;},undefined,&lt;&lt;&quot;en&quot;&gt;&gt;,&lt;&lt;&gt;&gt;,{{127,0,0,1},...},...}])<br />2015-06-24 18:57:01.433 [error] &lt;0.326.0&gt; Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at &lt;0.568.0&gt; exit with reason undef in context child_terminated</code></div> <p>Please sgguest solution</p> Wed, 24 Jun 2015 14:32:41 +0000 sunil.kumar comment 65860 at https://www.ejabberd.im You configured ejabberd to https://www.ejabberd.im/node/24955#comment-65857 <p>You configured ejabberd to provide an XMPP server for the host name "example.com" right? Something like</p> <pre> hosts: - "example.com" </pre><p>And later you make HTTP requests providing in the HTTP client as host "localhost". Or at least that's what ejabberd HTTP server understands.</p> <p>As mod_rest is not serving a vhost called "localhost", it doesn't know which options to apply to that request. Solutions: either provide the proper host in the HTTP request, or add that vhost to ejabberd.yml list of served hostnames.</p> Wed, 24 Jun 2015 09:53:56 +0000 badlop comment 65857 at https://www.ejabberd.im I think it means you should https://www.ejabberd.im/node/24955#comment-65853 <p>I think it means you should also start the module from the modules section as well.</p> Wed, 24 Jun 2015 07:56:33 +0000 mremond comment 65853 at https://www.ejabberd.im