when i have tried to deploy a php project in another system i got a error like this
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'image.jpg' for writing: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/WISMAN/pmhome.php on line 61
here i am getting a json after calling a web service to get a json as a response which contains a image in the string form,which i am encoding it into an image and saving it as image.jpeg but shows this one
<?php
$userid=$_SESSION[user_id];
//echo $userid;
$useridofuser=array(
'user_id'=> "$userid");
//echo json_encode($useridofuser);//coverting the vlaues collected from form into json
//calling the web service
$url='webservice url';
$data=$useridofuser;
//echo("Input to Server : ".$data."\n");
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($useridofuser));
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$response= curl_exec($ch);
echo('\n'."Server response : \n \n".$response);
curl_close($ch);
//parsing the json response from server
$jsonde="$response";
$json_o=json_decode($jsonde);
$json_a=json_decode($jsonde,true);
//echo("$json_a");
$company_name=$json_a[user_data][company_name];
$name=$json_a[user_data][name];
$registration_date=$json_a[user_data][registration_date];
$user_id=$json_a[user_data][user_id];
$product_id=$json_a[product_data][0][product_id];
$product_registration_id=$json_a[product_data][0][product_registration_id];
$product_name=$json_a[product_data][0][product_name];
$registration_date=$json_a[product_data][0][registration_date];
$image=$json_a[product_data][0][image];
$expiry_date=$json_a[product_data][0][expiry_date];
$product_evaluation_level=$json_a[product_data][0][product_evaluation_level];
$_SESSION[regid]=$product_registration_id;
if($product_evaluation_level=="1")
{
$level=trial;
}
$image_base64="$image";
$img = imagecreatefromstring(base64_decode($image_base64));
if($img != false)
{
imagejpeg($img, 'image.jpg');
} ?>