0
내 웹 서버에 SOAP가 올바르게 설치되어 있습니다 (phpinfo에 Soap Client/Server - Enabled가 있음).PHP SOAP 치명적인 오류 메시지
나는 원격 젠토 저장소에 SOAP 요청을 만들려고 해요, 난이 오류 메시지가 받고 있어요 : 여기
[Mon Aug 29 20:13:59 2011] [error] [client 79.178.13.67] PHP Fatal error: Uncaught SoapFault exception: [0] Unable to load Soap extension on the server in /home/example/public_html/mag/index.php:3
Stack trace:
#0 [internal function]: SoapClient->__call('login', Array)
#1 /home/example/public_html/mag/index.php(3): SoapClient->login('user', 'pass')
#2 {main}\n thrown in /home/example/public_html/mag/index.php on line 3
코드 :
$client = new SoapClient('http://www.example.com/api/soap/?wsdl=1');
$session = $client->login('user','pass');
$attributeSets = $client->call($session,'product_attribute_set.list');
$set = current($attributeSets);
$sku = 'iphone-12345';
$imagePath="../image.jpg";
$newProductData = array(
'name' => 'iPhone',
'websites' => array(1),
'short_description' => 'short description',
'description' => 'description',
'price' => 150,
'status' => '1',
);
$newImage = array(
'file' => array(
'name' => 'file_name',
'content' => base64_encode(file_get_contents($imagePath)),
'mime' => 'image/jpeg'
),
'label' => 'Cool Image',
'position' => 0,
'types' => array('image','small_image','thumbnail'),
'exclude' => 0
);
$imageFilename = $client->call($sessionId, 'product_media.create', array($sku,$newImage));
$productId = $client->call($session,'product.create',array('simple', $set['set_id'],$sku,$newProductData));
echo $productId;
어떤 아이디어?
감사합니다,
서버 설치 및 구성을 확인하십시오. http://www.magentocommerce.com/boards/viewthread/20556/ –
@Marek Sebera - Magento 서버와 다른 서버에서 스크립트를 실행하고 있는데 영향이 있습니까? 나는 wsdl url을로드 할 때 올바른 XML 응답을 얻을 때 SOAP가 magento 서버에 올바르게 설치되어 있음을 알고 있습니다. –
다른 서버에서 다른 VirtualHost 또는 전체 서버 (전체 Apache, httpd, nginx, ... 인스턴스)를 의미합니까? 오류 메시지에는 SOAP 확장을로드하는 데 문제가 있으므로 구성이 잘못되었을 수 있습니다. –