<div dir="ltr"><div><div><div><div><div><div>Hello Mariusz,<br><br></div>thanks for the tips.<br></div>What the true help to achieve in the code<br><br></div>I am not able to run any sh files fo I found a workaound I have created a php file<br>#!/usr/local/bin/php<br><?php<br>$url = '<a href="https://www.lib-assur.com/vtiger/vtigercron.php">https://www.lib-assur.com/vtiger/vtigercron.php</a>';<br>$ch = curl_init($url);<br>curl_setopt($ch, CURLOPT_URL, $url);<br>curl_setopt($ch, CURLOPT_HEADER, 0);<br>$data = curl_exec($ch);<br>curl_close($ch);<br>exit;<br>?><br><br></div>so I go around the problem of error headers...and the page vtigercron is acting like it was called from web so I just add to adjust the PHP_SAPI === 'cli'to the paramter of my server and it works like a charm <br><br></div>Thanks for the help and tips to all<br><br></div>Kind Regards<br><div><div><div><br><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Christophe Humbert<br><br><br></div></div>
<br><div class="gmail_quote">On Wed, Jul 1, 2015 at 10:54 AM, Mariusz Krzaczkowski <span dir="ltr"><<a href="mailto:m.krzaczkowski@yetiforce.com" target="_blank">m.krzaczkowski@yetiforce.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>Hi,</p>
<p>There are two ways to run cron:<br><b>1. Run directly PHP file: vtigercron.php</b><br>But you need add in IF "<b>true &&</b>" e.x. <br>if(<b>true &&</b> PHP_SAPI === "cli" || (isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key)){</p>
<p>But this method is not completely safe</p>
<p><b>2. Use the script SH: cron/vtigercron.sh</b><br>A few actions are required:</p>
<ul>
<li><span style="font-size:10pt">Grant permissions 777 or 755 (cron/vtigercron.sh)</span></li>
<li><span style="font-size:10pt">Set the path to PHP e.x. export USE_PHP=php , USE_PHP=/usr/local/php53/bin/php</span></li>
<li><span style="font-size:10pt">Check whether PHP.ini configuration for CLI console is correct</span></li>
</ul>
<div>---<br>
<p>Z poważaniem / Regards</p>
<div> </div>
<div><b>Mariusz Krzaczkowski</b></div>
<div><i>Director of Product Development</i></div>
<div>M: <a href="tel:%2B48%20884-998-123" value="+48884998123" target="_blank">+48 884-998-123</a><br>E: <a title="Mail do Mariusz Krzaczkowski" href="mailto:m.krzaczkowski@yetiforce.com" rel="noreferrer" target="_blank">m.krzaczkowski@yetiforce.com</a></div>
<hr>
<p><span>We created an innovative open source project called YetiForceCRM. You can test it </span><a href="https://test.yetiforce.com/" rel="noreferrer" target="_blank">here</a><span>, </span><a href="https://github.com/YetiForceCompany/YetiForceCRM" rel="noreferrer" target="_blank">download</a><span> it for free or read its </span><a href="https://yetiforce.com/en/documentation.html" rel="noreferrer" target="_blank">documentation</a><span>. Follow us on </span><a href="https://twitter.com/YetiForceEN" rel="noreferrer" target="_blank">Twitter</a><span> to get real-time info about new functionalities and articles.</span></p>
</div>
<p> </p>
<p>W dniu 2015-07-01 10:04, Alan Lord napisał(a):</p>
<blockquote type="cite" style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">
<div style="margin:0;padding:0;font-family:monospace">On 01/⁠07/⁠15 08:30, Christophe Humbert wrote:
<span class=""><blockquote type="cite" style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">Hello Guys<br><br> until now I was using a webcron to launch vtigercron.php but I would<br> like ti use the cron of my shared hosting (no access to shell) and when<br> I am launching the vtigercron.php through the cron I have the following<br> : error reading from the headers  anyone an idea</blockquote>
<br> I would try and use the shell helper script rather than run php directly.<br><br> So your cron entry looks like:<br><br>
</span><blockquote type="cite" style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">*/⁠15 * * * * sh /⁠path/⁠to/⁠vtiger/⁠cron/⁠vtigercron.sh</blockquote><span class="">
<br> <rant><br> Shared hosts are a complete PITA.<br><br> Some shared hosts limit the version of the PHP cli your cron can access.<br><br> Another thing we found with our GeoTools module on shared hosts can be that the cron jobs are limited to some arbitrary time and they can be terminated by the shared hosting engine (CPanel, Plesk or whatever) so be aware that if you have a long job (like an import or loads of emails/workflows) then the script might get killed prematurely.<br></span> </⁠rant><br><br> Al<br><br><br><br><br> _______________________________________________<br><a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a></div>
</blockquote>
</div>
<br>_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br></blockquote></div><br></div></div>