Merhabalar hali hazırda calısan bir sitemde cronjub tanımladım ve
[2020-07-16 20:00:02] local.ERROR: The Process class relies on proc_open, which is not available on your PHP installation. {"exception":"[object] (Symfony\Component\Process\Exception\LogicException(code: 0): The Process class relies on proc_open, which is not available on your PHP installation. at /home/simavyor/public_html/vendor/symfony/process/Process.php:143)
hatası alıyorum
cron job su sekilde
/usr/local/bin/php /home/simavyor/public_html/artisan schedule:run >> /dev/null 2>&1
Kernel.php ise
`<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
Commands\currencyTranslate::class,
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('currency:transform')->everyThirtyMinutes();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
currencyTranslate.php dosyası ise
<?php
namespace App\Console\Commands;
use Illuminate\Support\Facades\Log;
use App\Currency;
use GuzzleHttp\Client;
use Illuminate\Console\Command;
class currencyTranslate extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'currency:transform';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Para Birimlerini Apiden Al覺r Ve G羹nceller ';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function handle()
{
try{
$client = new Client();
$response = $client->request('GET', 'https://api.ratesapi.io/api/latest?base=TRY');
$apiResult = $response->getBody();
$apiResultJson=json_decode($apiResult,true);
$USD=round($apiResultJson["rates"]["USD"],2);
$EUR=round($apiResultJson["rates"]["EUR"],2);
$RUB=round($apiResultJson["rates"]["RUB"],2);
$BGN=round($apiResultJson["rates"]["BGN"],2);
$cuurencys= Currency::find(1);
$cuurencys->update([
'EUR'=>$EUR,
'USD'=>$USD,
'RUB'=>$RUB,
'BGN'=>$BGN
]);
Log::info('İşlem Başarılı');
}catch (\Exception $e){
Log::info('İslem basarisiz');
}
}
}
`
bu şekilde proc_open guvenlik nedeniyle acılamıyormus .. eger hata bende ise lütfen yardımcı olur musunuz ? eger değilse laravel için önerebileceğiniz host firması var mı daha önce cloud bir server denemediğim için forumdaki yazıları okudum ve mail almak gibi işlemlerin c paneldeki gibi kolay olmadıgını okudum ...tesekkürler