دعم الموقع

Hi new user here, before sending random requests and making the server self destruct.... well that's the level of luck i have i thought id test php code generated by the try it yourself examples in the api documentation.

the code generation for php generated https://developers.themoviedb.org/3/credits gave the following error:

cURL Error #:SSL certificate problem: unable to get local issuer certificate

The php tested was

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.themoviedb.org/3/credit/%7Bcredit_id%7D?api_key=apikeyremoved",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "{}",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}?>

I am using AMPPS like wamps but imho better to test locally. can anyone offer any pointers to correct this?

Many thanks

NW

1 رد (على هذه الصفحة 1 من 1)

Jump to last post

If I was to guess, it's the issue that is mentioned down the page a bit, here (this link should take you to the answer I'm referencing). I think you need to update the local certificates that cURL is using. If you don't want to to do this the only option is to tell cURL to not verify the host. Which I think is this command:

curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);

I'm not clear if you also need this line (maybe?):

curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);

But, having said all of this, if you're not interested in validating SSL, you might as well just use http instead in which case none of this applies and just update the URL.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول