MRatWork Forum by Mustafa Ramadhan - Cron Job malah Error Saat Pakai Nginxproxy

Sponsor:
Server and Web Integrator
Link:
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:

MRatWork Forum | Please login or register. | 2017-11-07, 17:27:49

- MRatWork Forum by Mustafa Ramadhan »
- Language Specific Discussions »
- Indonesia Users »
- Cron Job malah Error Saat Pakai Nginxproxy

« previous next »

- Print

Pages: [1] 2 Go Down

### Author Topic: Cron Job malah Error Saat Pakai Nginxproxy (Read 1907 times)

0 Members and 1 Guest are viewing this topic.

#### flameblue59

- Senior Member
- Posts: 172
- Karma: +0/-0

##### Cron Job malah Error Saat Pakai Nginxproxy

« on: 2017-03-18, 05:01:10 »
Selamat pagi, saya ada kendala dengan cron job yang malah error. Padahal saat sebelumnye menggunakan nginx tidak pernah ada masalah. Berikut ini cron job yang ingin dijalankan.
http://1ori.com/cronbobby1993.php
Mengalami error seperti ini
Code: [Select]

    Error 500 - Internal Server Error

    A generic error message, given when no more specific message is suitable

Mohon bantuannya para sesepuh. Thanks
---------- UPDATE -----------
Cron file sudah bisa jalan, Error 500 karena cron file diakses dalam jedah yang singkat. Masalah barunya, settingan cron job tidak mau jalan dengan command berikut.
curl http://1ori.com/cronbobby1993
Coba tes di ssh jalan.
Code: [Select]

    [root@server ~]# curl http://1ori.com/cronbobby1993
    sukses[root@server ~]#

Mohon bantuannya. Thanks
« Last Edit: 2017-03-18, 05:58:17 by flameblue59 »
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #1 on: 2017-03-18, 08:13:06 »
Tampilkan settingan cron job anda.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### flameblue59

- Senior Member
- Posts: 172
- Karma: +0/-0

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #2 on: 2017-03-18, 08:19:48 »
ini pak
curl http://1ori.com/cronbobby1993.php localhost simple --all-- --all-- --all-- --all-- --all--
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #3 on: 2017-03-18, 09:18:52 »
Jika dalam cronbobby1993.php ada function dari php yang tidak diizinkan (misalnya exec) maka akan memunculkan error.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### flameblue59

- Senior Member
- Posts: 172
- Karma: +0/-0

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #4 on: 2017-03-18, 18:17:51 »
kalau pakai nginx bisa pak MR. tapi karena saya mau pakai .htaccess, jadi pakai nginxproxy. Sayangnya malah cron yang tidak bisa bekerja.
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #5 on: 2017-03-18, 19:43:48 »
Memangnya apa isi dari file php tersebut.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### flameblue59

- Senior Member
- Posts: 172
- Karma: +0/-0

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #6 on: 2017-03-19, 04:22:14 »
Ini pak MR
Code: [Select]

    <?php
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
    date_default_timezone_set('Asia/Jakarta');
    $waktuserver = date('Y-m-d H:i:s');
    $file = "cookie.txt";
    require_once('config.php');
    require_once('simple_html_dom.php');
    $sql = "SELECT * FROM databasegame ORDER BY cron ASC LIMIT 0,1";
    $process = $conn->query($sql) or die("Error: ".mysqli_error($conn));
    if(mysqli_num_rows($process) > 0){
    	while($row=$process->fetch_assoc()){
    		$id = $row['id'];
    	}
    }
    $hargaoriginal = 0;
    $hargadiscount = 0;
    $dctime = "";
    $waktu = "";
    $sql = "SELECT * FROM databasegame WHERE id='$id' and appid!='' and jasa='1' and platform='steam' ORDER BY cron ASC LIMIT 0,1";
    $process = $conn->query($sql) or die("Error: ".mysqli_error($conn));
    if(mysqli_num_rows($process) > 0){
    	while($row=mysqli_fetch_assoc($process)){
    		$nama = $row['nama'];
    		$platform = $row['platform'];
    		$id = $row['id'];
    		$appid = $row['appid'];
    	}
    $nama = explode(" ",$nama);
    $nama = implode("+",$nama);
    $url = "http://store.steampowered.com/search/?snr=1_7_7_151_12&term=$nama&cc=id";
    $ch = curl_init();
    $fp = fopen(dirname(__FILE__).'/errorlog.txt', 'w');
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_STDERR, $fp);
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1');
    curl_setopt($ch,CURLOPT_MAXREDIRS,10);
    curl_setopt($ch,CURLOPT_AUTOREFERER,true);
    curl_setopt($ch,CURLOPT_COOKIE,true);
    curl_setopt($ch,CURLOPT_COOKIESESSION,true);
    curl_setopt($ch,CURLOPT_COOKIEJAR,$file);
    curl_setopt($ch,CURLOPT_COOKIEFILE,$file);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
    $data = curl_exec($ch);

    $html = new simple_html_dom();
    $html->load($data,true,false);

    foreach($html->find('a[data-ds-appid="'.$appid.'"] div[class="responsive_search_name_combined"] div[class="col search_price_discount_combined responsive_secondrow"] div[class="col search_price  responsive_secondrow"]') as $block){
    	$hargaoriginal = $block->plaintext;
    }

    foreach($html->find('a[data-ds-appid="'.$appid.'"] div[class="responsive_search_name_combined"] div[class="col search_price_discount_combined responsive_secondrow"] div[class="col search_price discounted responsive_secondrow"]') as $block){
    	$harga = $block->plaintext;
    	$harga = explode('Rp ',$harga);
    	$hargaoriginal = $harga[1];
    	$hargadiscount = $harga[2];
    }

    //fungsi convert harga
    $arrayconvert = explode(' ',$hargaoriginal);
    $hargaoriginal = implode('',$arrayconvert);
    $arrayconvert = explode('Rp',$hargaoriginal);
    $hargaoriginal = implode('',$arrayconvert);
    $arrayconvert = explode(' ',$hargadiscount);
    $hargadiscount = implode('',$arrayconvert);
    $arrayconvert = explode('Rp',$hargadiscount);
    $hargadiscount = implode('',$arrayconvert);

    $hargaoriginal = intval($hargaoriginal);
    $hargadiscount = intval($hargadiscount);
    //fungsi fix data
    if($hargaoriginal==NULL){
    	$hargaoriginal = 0;
    }
    if($hargadiscount==NULL){
    	$hargadiscount = 0;
    }
    if($dctime==NULL){
    	$dctime = '';
    }
    if($waktu==NULL){
    	$waktu = '';
    }

    $sql = "SELECT * FROM hargagame WHERE idgame='$id' and jenis='jasa' and platform='$platform'";
    $process = $conn->query($sql) or die("Error :".mysqli_error($conn));
    if(mysqli_num_rows($process) > 0){
    	while($row=$process->fetch_assoc()){
    		$sql_sub = "UPDATE hargagame SET hrgoriginal='$hargaoriginal', hrgdiscount='$hargadiscount', dctime='$dctime' WHERE idgame='$id' and jenis='jasa' and platform='$platform'";
    		$process_sub = $conn->query($sql_sub) or die("Error1 :".mysqli_error($conn));
    	}
    }
    if(mysqli_num_rows($process) == 0){
    	$sql_sub = "INSERT INTO hargagame (idgame,jenis,platform,hrgoriginal,hrgdiscount,dctime) VALUES ('$id','jasa','$platform','$hargaoriginal','$hargadiscount','$dctime')";
    	$process_sub = $conn->query($sql_sub) or die("Error2 :".mysqli_error($conn));
    }

    curl_close($ch);
    }
    require_once('cdkeys.php');
    require_once('hrkgame.php');

    $sql = "UPDATE databasegame SET hrgoriginal = '$hargaoriginal', hrgdiscount = '$hargadiscount', dctime = '$dctime', cron= '$waktuserver' WHERE id='$id'";
    $process = $conn->query($sql) or die("Error: ".mysqli_error($conn));
    echo 'sukses';
    ?>

« Last Edit: 2017-03-19, 04:28:31 by flameblue59 »
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #7 on: 2017-03-19, 04:28:05 »
Kalau anda jalankan file php tersebut dari browser apakah error 500 juga?.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### flameblue59

- Senior Member
- Posts: 172
- Karma: +0/-0

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #8 on: 2017-03-19, 04:29:49 »
bisa pak MR, saya sudah coba di browser dan ssh bisa jalan. Untuk di ssh saya menggunakan command yang sama sesuai dengan yang di cron job. Tapi kalau di cron job tidak mau jalan.
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #9 on: 2017-03-19, 04:34:34 »
Cron tersebut username-nya apa?. Silahkan lihat kembali list dari cron tersebut.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### flameblue59

- Senior Member
- Posts: 172
- Karma: +0/-0

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #10 on: 2017-03-19, 05:04:15 »
maksudnya username bagaimana pak MR? mohon maaf pak saya kurang konek.
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #11 on: 2017-03-19, 05:29:32 »
Pada daftar cron akan terlihat setiap cron dimiliki oleh username apa?.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #12 on: 2017-03-19, 05:30:57 »
Coba lihat melalui 'admin > all > all cron tasks'
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### flameblue59

- Senior Member
- Posts: 172
- Karma: +0/-0

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #13 on: 2017-03-19, 05:44:57 »
sudah saya lihat pak MR.
Berikut ini listnya
Code: [Select]

    	-	admin	curl http://1ori.com/cronbobby1993.php	localhost	simple	--all--	--all--	--all--	--all--	--all--

Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: Cron Job malah Error Saat Pakai Nginxproxy

« Reply #14 on: 2017-03-19, 09:14:10 »
Lakukan cron job melalui 'admin > servers > localhost > cron tasks'.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

- Print

Pages: [1] 2 Go Up
« previous next »

- MRatWork Forum by Mustafa Ramadhan »
- Language Specific Discussions »
- Indonesia Users »
- Cron Job malah Error Saat Pakai Nginxproxy

Top 10 Social Networking: Facebook Twitter LinkedIn Pinterest Google Plus Tumblr Instagram VK Flickr Vine

- Design By SMFSimple.com
- SMF 2.0.14 | SMF © 2017, Simple Machines

Page created in 0.05 seconds with 17 queries.

Mirror created by MasterkinG32.CoM