简体   繁体   English

PHP升级到5.4时失败

[英]PHP fails when upgraded to 5.4

I am using PHP with MySQL to pull programs, courses, etc. on 2003 box with PHP 5.2. 我将PHP与MySQL配合使用,以在PHP 5.2的2003包装盒上提取程序,课程等。 I am transferring my site to a new 2008 box with PHP 5.4 (because of injection exploits on database). 我将我的网站转移到一个新的装有PHP 5.4的2008机器中(由于对数据库的注入攻击)。 My data still pulls to my site (programs, courses etc) from my new server. 我的数据仍从新服务器拉到我的站点(程序,课程等)。

The issue is I have a page that is for login and will not load (HTTP 500 error). 问题是我有一个用于登录且无法加载的页面(HTTP 500错误)。 I have traced back to section of code that kicks out and believe it is the session_start() . 我已经追溯到开始的代码部分,并认为它是session_start() I know in 5.3 it changed and will now return false if it fails to start instead of the previous true. 我知道在5.3中它已更改,如果无法启动,它将现在返回false,而不是以前的true。

I've tried echoing out what loads line by line with each variable since I can compare it with the two versions. 我尝试逐行回显每个变量加载的内容,因为我可以将其与两个版本进行比较。 I've tried starting the session at the beginning. 我已经尝试过从头开始会议。 Ending it before my code, etc. It seems simple, but I haven't got it to work yet. 在我的代码等之前结束它。这似乎很简单,但是我还没有开始工作。

Here's the beginning of my page "login-inc-header.php": 这是我的页面“ login-inc-header.php”的开始:

<?php
    if(!isset($session_started)) $session_started = session_start();
    // avoids duplicate pstings
    header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    ini_set("display_errors", "1");
    if(!isset($requires)) $requires = "User";
    include_once("includes/handleLogin.php"); 
    include_once("../includes_app/db_settings.php");
?>

If I remove this block, The page will load just without my login boxes. 如果删除此阻止,则该页面将在没有我的登录框的情况下加载。 Pages works perfect in version 5.2. Pages在5.2版中完美运行。 Ideas? 想法?

My db_settings: 我的db_settings:

<?php
    //$site_root = "/var/www/html/";
    $site_root = "C:\\Inetpub\\wwwroot\\";  //changed 12-13-13 for new server
    //$site_root = substr($_SERVER['PATH_TRANSLATED'], 0, (-1 * strlen($_SERVER['PATH_INFO'])));
    $site_url = "http://10.20.251.60/";

    include_once($site_root."includes_app/adodb/adodb.inc.php");
    $db =& ADONewConnection('mysql');
    $db->Connect("localhost", "####", "####", "####");

    $db->SetFetchMode(ADODB_FETCH_ASSOC);

    // for mysql only...make sure we are NOT in strict mode
    $db->Execute("SET sql_mode=''");

    $tblprefix = "";
    $extraFieldLabHours = true; 
    $extraFieldOBIHours = true; 
    $extraFieldsPrereqCoreq = true;
    $extraFieldProgramRequirements = true;
    $maxCourseCodeLength = 4;
    $maxCoursePrefixLength = 4; // 11-05-10 added this line to fix prefix length
    $exportReport[$site_url.'includes_app/html_word_export.php'] = "Export for Microsoft Word 2007";
    $exportReport[$site_url.'includes_app/html_rtf_export.php'] = "Export for Adobe InDesign CS2";
    $exportReport[$site_url.'directory/print.php'] = "Export Directory to HTML";
    $sysadmin_email = "gntc@gntc.edu";
    $extraModuleEmployeeDirectory = true;
    $extraModuleCampusAlert = true;
    $extraFieldAtAGlance = true;
    $areas = array();
    $configAreasResult = $db->Execute("SELECT dbName, displayName FROM ".$tblprefix."areas ORDER BY sequence");
    while($configRow = $configAreasResult->fetchRow()) $areas[$configRow['dbName']] = $configRow['displayName'];
    $program_types = array();
    $configProgramTypesResult = $db->Execute("SELECT dbName, displayName FROM ".$tblprefix."program_types ORDER BY sequence");
    while($configRow = $configProgramTypesResult->fetchRow()) $program_types[$configRow['dbName']] = $configRow['displayName'];
    $extraFieldCampus = array();
    $configCampusesResult = $db->Execute("SELECT displayName FROM ".$tblprefix."campuses ORDER BY sequence");
    while($configRow = $configCampusesResult->fetchRow()) $extraFieldCampus[] = $configRow['displayName'];
    $extraFieldEmployeeOfficeHours = true;
    $extraFieldEmployeeBio = true;
    $extraFieldEmployeePicture = true;
    $extraFieldFoptNumRequirements = true;
    $alternateTitleGeneralCoreCourses = "General Core Curriculum";
    $alternateTitleOccupationalCourses = "Occupational Curriculum";
    $extraModuleCampusAlert = true; // added on 3-10-10 to make campus alert feature work
    $alternateTitleEmployeeEducation = "Credentials"; $showBannerID = true;  
    $deeperMenus = true; 
    $importModules = array(); 
    $importModules['import_courses_xml.php'] = "Courses XML"; 
    $importModules['import_employees_xml.php'] = "Employees XML"; 
    $extraModuleDivisions = true; 
    $gntc_local_upload_dir = $site_root."uploads/"; 
    $gntc_web_upload_dir = $site_url."uploads/"; 
    $exportReport[$site_url.'includes_app/phone_sheet_csv.php'] = "Phone Sheet CSV";
?>

Log File: 日志文件:

[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(includes/handleLogin.php): failed to open stream: No such file or directory in C:\\inetpub\\wwwroot\\login\\includes\\header.php on line 8 [2014年1月16日21:17:46 UTC] PHP警告:include_once(includes / handleLogin.php):无法打开流:C:\\ inetpub \\ wwwroot \\ login \\ includes \\ header.php中没有此类文件或目录在第8行

[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(): Failed opening 'includes/handleLogin.php' for inclusion (include_path='.;C:\\php\\pear') in C:\\inetpub\\wwwroot\\login\\includes\\header.php on line 8 [2014年1月16日21:17:46 UTC] PHP警告:include_once():无法在C:\\ inetpub中打开包含(include_path ='.; C:\\ php \\ pear')的“ includes / handleLogin.php”第8行的\\ wwwroot \\ login \\ includes \\ header.php

[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(../includes_app/db_settings.php): failed to open stream: No such file or directory in C:\\inetpub\\wwwroot\\login\\includes\\header.php on line 9 [2014年1月16日21:17:46 UTC] PHP警告:include_once(../ includes_app / db_settings.php):无法打开流:C:\\ inetpub \\ wwwroot \\ login \\ includes \\中没有此类文件或目录第9行的header.php

[16-Jan-2014 21:17:46 UTC] PHP Warning: include_once(): Failed opening '../includes_app/db_settings.php' for inclusion (include_path='.;C:\\php\\pear') in C:\\inetpub\\wwwroot\\login\\includes\\header.php on line 9 [2014年1月16日21:17:46 UTC] PHP警告:include_once():无法在C中打开包含(include_path ='.; C:\\ php \\ pear')的'../includes_app/db_settings.php'第9行的:\\ inetpub \\ wwwroot \\ login \\ includes \\ header.php

[16-Jan-2014 21:17:46 UTC] PHP Notice: Undefined variable: title in C:\\inetpub\\wwwroot\\login\\includes\\header.php on line 16 [2014年1月16日21:17:46 UTC] PHP注意:未定义的变量:第16行的C:\\ inetpub \\ wwwroot \\ login \\ includes \\ header.php中的标题

[16-Jan-2014 21:17:46 UTC] PHP Notice: Undefined variable: title in C:\\inetpub\\wwwroot\\login\\includes\\header.php on line 159 [2014年1月16日21:17:46 UTC] PHP注意:未定义的变量:第159行的C:\\ inetpub \\ wwwroot \\ login \\ includes \\ header.php中的标题

I noticed that this referenced PEAR, which in not installed by default like older versions. 我注意到这引用了PEAR,默认情况下未像旧版本那样安装PEAR。 Could this be the issue? 这可能是问题吗?

You have put this as your site root 您已将此作为您的网站根目录

$site_root = "C:\\Inetpub\\wwwroot\\";

Try putting 试穿

$site_root = "http://yourhost/folder_name/"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您能看到为什么当php从5.2升级到5.4版本时此表单无法工作的原因 - Can you see why this form fails to work when php is upgraded from 5.2 to version 5.4 升级到5.4,但“php -v”仍然返回旧版本 - Upgraded to 5.4 but “php -v” still returns older version 在PHP 5.4 easy php开发服务器中使用双引号时,include和require调用失败 - include and require call fails when Double quote is used in php 5.4 easy php dev server Magento管理类别页面在PHP 5.4上失败 - Magento admin category page fails on PHP 5.4 为什么在PHP 5.4中文件夹的&#39;include&#39;失败 - Why fails 'include' with folder in PHP 5.4 升级到PHP 5.4,现在我不再在网站上显示的Facebook链接统计信息 - Upgraded to PHP 5.4 and now facebook link stats I was pulling no longer show on site 升级的Laravel 5.6的Envoyer部署无法引用不匹配的PHP版本 - Envoyer deployment of upgraded Laravel 5.6 fails quoting mismatched PHP versions 在PHP 5.1上创建和下载ZipArchive失败,在PHP 5.4上有效 - Creating and downloading ZipArchive fails on PHP 5.1, works on PHP 5.4 升级到Laravel 5.4-现在有些路线失败了? - Upgraded to Laravel 5.4 - Some routes now fail? 当我尝试安装php 5.4时出错 - Error when I try to install php 5.4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM