Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试在本地打开 Bitrix 站点,下载所有文件和数据库,自定义配置。但一个错误:
致命错误:在第 26 行的 /home/rootname/www/site/site_op/index.php 中的 null 上调用成员函数 SetPageProperty() $APPLICATION->SetPageProperty("description", "text"); $APPLICATION 类为 NULL。
致命错误:在第 26 行的 /home/rootname/www/site/site_op/index.php 中的 null 上调用成员函数 SetPageProperty()
$APPLICATION->SetPageProperty("description", "text");
$APPLICATION 类为 NULL。
可能是什么问题呢 ?
$APPLICATION不是一个类。它是一个实例,CMain它是全局变量。
$APPLICATION
CMain
显然,您$APPLICATION在某个函数的范围内调用。而且这个功能不知道$APPLICATION. 在这种情况下,添加global关键字并使用它:
global
global $APPLICATION; $APPLICATION->SetPageProperty("description", "text");