Allow Cron Jobs to access PHP/WGet/FTP in Plesk 10.1+
As of Plesk 10.1 cron jobs have been restricted to a chroot jail that prevents it from using many linux commands. Run the following as root and it will function like the old Plesk used to.
/usr/local/psa/bin/server_pref -u -crontab-secure-shell "/bin/sh"
Concrete5 “Scheduled Jobs” Cron
Cpanel
wget http://www.domain.com/index.php/tools/required/jobs?auth=dc56540cbda34e02ce9ab06e30d5353a
Plesk
wget http://www.duetip.com/index.php/tools/required/jobs?auth=1db374a912d951a526d70fcfa38fdb17 -O /dev/null
PHP To Call Page
http://somethingsomething.com/store/cron/create_orders_cron.php
<?php $host = "www.somethingsomething.com"; $user = ""; $password = ""; $socket = @fsockopen($host, 80, $errno, $errstr, 30); if (!$socket) { echo "Failed to open socket<br>{$errno}<br>{$errstr}"; exit; } // Encode authentication string $authstr = $user.":".$password; $pass = base64_encode($authstr); // Make GET to sphider fputs($socket,"GET /store/cron/create_orders.php HTTP/1.0\r\n"); fputs($socket,"Host: {$host}\r\n"); //fputs($socket,"Authorization: Basic $pass\r\n"); fputs($socket,"Connection: Close\r\n"); fputs($socket,"\r\n"); // Grab response after the headers $past_headers = 0; while (!feof($socket)) { $response = fgets($socket,4096); //echo $response; if($past_headers) $html .= $response; if($response == "\r\n") $past_headers = 1; } fclose($socket); if(strlen($html) < 2000) { //echo $html; } ?>
Recent Comments