Answer the question
In order to leave comments, you need to log in
How to fix errors while executing php script?
I am uploading product properties and fields from xml to Bitrix .
I have xml with files that need to be synchronized
<xml>
<Files>
<File href="/home/bitrix/ext_www/optguru.ru/upload/exchange_product/exchangeProductSku_1.xml"/>
<File href="/home/bitrix/ext_www/optguru.ru/upload/exchange_product/exchangeProductSku_2.xml"/>
...
<File href="/home/bitrix/ext_www/optguru.ru/upload/exchange_product/exchangeProductSku_8.xml"/>
<File href="/home/bitrix/ext_www/optguru.ru/upload/exchange_product/exchangeProductSku_9.xml"/>
</Files>
</xml>
<Product>
<Fields>
<Field name="IBLOCK_ID">
<Value value="10"/>
</Field>
...
<Field name="DETAIL_PICTURE">
<Value value="/home/bitrix/ext_www/somebox.ru/upload/iblock/848/848f0af4929ee54080c9385cb4c1e764.jpg"/>
</Field>
</Fields>
<Properties>
<Property name="Цвет" property_type="S" multiply="N">
<Value value="black"/>
</Property>
<Property name="Картинки" property_type="F" multiply="Y">
<Value value="/home/bitrix/ext_www/somebox.ru/upload/iblock/656/656a385443ce96a1479fd8955f426b34.jpg"/>
<Value value="/home/bitrix/ext_www/somebox.ru/upload/iblock/d5e/d5e25ed1c4872e1dad379c2e08d7bee5.jpg"/>
</Property>
</Properties>
</Product>
$el = new CIBlockElement;
$res = $el->Update($PRODUCT_ID, $fields);
CIBlockElement::SetPropertyValuesEx($PRODUCT_ID, CATALOG_SKU_IBLOCK, $properties);
[[email protected] ~]$ /usr/bin/php /home/bitrix/ext_www/optguru.ru/include/tools/exchangeProductIn.php
PHP Fatal error: require_once(): Failed opening required '/home/bitrix/ext_www/optguru.ru/bitrix/modules/main/include/epilog_after.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/bitrix/ext_www/optguru.ru/include/tools/exchangeProductIn.php on line 249
PHP Stack trace:
PHP 1. {main}() /home/bitrix/ext_www/optguru.ru/include/tools/exchangeProductIn.php:0
PHP Fatal error: require_once(): Failed opening required '/home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandlerlog.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/loader.php on line 377
PHP Stack trace:
PHP 1. {main}() /home/bitrix/ext_www/optguru.ru/include/tools/exchangeProductIn.php:0
PHP 2. Bitrix\Main\Diag\ExceptionHandler->handleFatalError() /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandler.php:0
PHP 3. spl_autoload_call() /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandler.php:350
PHP 4. Bitrix\Main\Loader::autoLoad() /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandler.php:350
Fatal error: require_once(): Failed opening required '/home/bitrix/ext_www/optguru.ru/bitrix/modules/main/include/epilog_after.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/bitrix/ext_www/optguru.ru/include/tools/exchangeProductIn.php on line 249
Call Stack:
0.0005 399480 1. {main}() /home/bitrix/ext_www/optguru.ru/include/tools/exchangeProductIn.php:0
Fatal error: require_once(): Failed opening required '/home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandlerlog.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/loader.php on line 377
Call Stack:
0.0005 399480 1. {main}() /home/bitrix/ext_www/optguru.ru/include/tools/exchangeProductIn.php:0
1211.3847 147692632 2. Bitrix\Main\Diag\ExceptionHandler->handleFatalError() /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandler.php:0
1211.3847 147694944 3. spl_autoload_call() /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandler.php:350
1211.3847 147695064 4. Bitrix\Main\Loader::autoLoad() /home/bitrix/ext_www/optguru.ru/bitrix/modules/main/lib/diag/exceptionhandler.php:350
Answer the question
In order to leave comments, you need to log in
Perhaps you need to specify the absolute path to the scripts when connecting
require_once __DIR__ .'/home/bitrix/ext_www/optguru.ru/bitrix/modules/main/include/epilog_after.php';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question