1
我有我的PHP脚本一个小问题。这个使用Magento API并尝试为产品创建媒体。创建媒体 - Magento的API(SOAP)
$imageData = array(
'file' => array(
'name' => 'myimage.jpg',
'content' => base64_encode(file_get_contents($product_image_url)),
'mime' => 'image/jpeg'
),
'label' => 'Product Image #4',
'position' => 1,
'types' => array('small_image','image','thumbnail'),
//'types' => array('image'),
'exclude' => 0
);
$image_create = $client->call($sessID, 'product_media.create', array($product_id, $imageData));
$client->call($sessID, 'product_media.update', array($product_id, $image_create));
当我运行此脚本有点像(约10ko,100×100像素),一切工作正常,但是当我试图用一个大的图像(140K,500×500像素)的肥皂返回此错误:
SoapFault exception: [HTTP] Internal Server Error in /var/www/vhosts/domain.com/httpdocs/test_update.php:46 Stack trace: #0 [internal function]: SoapClient->__doRequest('__call('call', Array) #2 /var/www/vhosts/domain.com/httpdocs/test_update.php(46): SoapClient->call('068bd88e8f56261...', 'product_media.c...', Array) #3 {main}
我的想法是,长度,当它是一个大的图像,BASE64_ENCODE的(的file_get_contents($ product_image_url))过大,然后肥皂失败。
也许Apache或PHP的conf文件?
Santerref。