Start now free!

Bitrix Products Technical FAQ

PHP Errors

  • Fatal error: Undefined class name 'ciblockelement' in ...
  • PHP code is returned when requesting a page
  • Fatal error: Using $this when not in object context ...
  • Fatal error: Unable to read XXX bytes in /XXX/XXX/ on line XXX
  • Fatal error: Allowed memory size of ... bytes exhausted...

  • Fatal error: Undefined class name 'ciblockelement' in ...

    I have copied a piece of code from the documentation but it does not work and the above error is displayed.

    You should connect the BSM kernel and the required module in your code before using the classes. In the end of the page, remember to include the footer.

    The following example illustrates the use of the Information Block module.

    <?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");?>
    <?
    if (CModule::IncludeModule('iblock'))
    {
    // work with module's class
    }
    else
    {
    echo “Failed to include the module”;
    }
    ?>
    <?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>




    PHP code is returned when requesting a page
    The PHP code enclosed in <? ?> is not processed.

    short_open_tag parameter is off as of version 5.1 and higher. As a result, the PHP code enclosed in the <? ?> format is not processed.

    Set the value of short_open_tag to on in php.ini.

    Fatal error: Using $this when not in object context ...
    The following error occurs:

    [CODE]Fatal error: Using $this when not in object context in /www/[/CODE]
    The error occurs with PHP 5 when calling non-static methods as functions. For example, the following code:

    $iCnt = CIBlockElement::GetCount();

    should be replaced with:

    $Element = new CIBlockElement;
    $iCnt = $CElement -> GetCount();


    Fatal error: Unable to read XXX bytes in /XXX/XXX/ on line XXX

    An error occurs:

    [CODE][Fatal error: Unable to read 63841 bytes in /disk2/clients/a1922/site.ru/htdocs/bitrix/modules/main/tools.php on line 0][/CODE]

    The error occurs when starting the trial (encoded) version of BSM. The files were possibly copied to the server via FTP not in the Binary mode. Zend-encoded files are binary; thus, ensure that the FTP client is set to the binary transfer mode.



    Fatal error: Allowed memory size of ... bytes exhausted...

    The error indicates that PHP is out of memory. Contact your hosting administrator to increase the "memory_limit" parameter in php.ini.



    Partner Program
    Free Online Training
    Subscribe to Bitrix News