1. used short tag - php_flag short_open_tag On
2. <Setting Name="PS" Value=":" /> - <Setting Name="PS" Value="::" />
3. define('PATH_SITE', dirname(__FILE__).'/'); -
define('PATH_SITE', str_replace('\\','/',dirname(__FILE__)).'/');
// use / in path for all OS
4. can't autoload Class - require the full path
OR
Simply <Setting Name="PS" Value=":" /> - <Setting Name="PS" Value=";" />
set the separator to semicolon in Windows.
2. <Setting Name="PS" Value=":" /> - <Setting Name="PS" Value="::" />
3. define('PATH_SITE', dirname(__FILE__).'/'); -
define('PATH_SITE', str_replace('\\','/',dirname(__FILE__)).'/');
// use / in path for all OS
4. can't autoload Class - require the full path
OR
Simply <Setting Name="PS" Value=":" /> - <Setting Name="PS" Value=";" />
set the separator to semicolon in Windows.
本文将探讨在PHP环境中设置PS设置以解决Class自动加载问题,并介绍如何在不同操作系统下配置路径以确保代码在所有环境下都能正常运行。
367

被折叠的 条评论
为什么被折叠?



