Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd Problems after Upgrade to v5.2.1 1

Status
Not open for further replies.

DonP

IS-IT--Management
Jul 20, 2000
684
US
After upgrading from the last v 4x version of PHP to the most recent v 5.2.1, the site runs but has some odd problems that I cannot seem to solve. I hope someone can help quickly as I am in a bind!

First, it loads a JavaScript menu which also contains SQL and PHP in order to be dynamic. The PHP code for loading it is as follows:

Code:
if ($GetLogin) {
	ob_start();
	include("misc/system_menu.js");
	$contents = ob_get_contents();
	ob_end_clean();
	echo "<script type=\"text/javascript\">" . $contents . "</script>";
}

The menu appears but, except for a couple hard-coded entries, it's empty and when viewing the source code of the page, it shows <?php $ItemName ?> rather than the actual values.

Also, the site has a facility for viewing uploaded MS-Word, MS-Excel (etc) documents in a new browser window. Although the mime-type is being sent to the header and they WERE working, now they load but the browser is empty.

One last thing, phpinfo() shows that the magic_mime file is invalid and has not loaded. I realize that magic_mime has been depreciated but I am not sure how else to do the job as I have never used PEAR.

This is running on IIS6, Windows 2003 Server.

Any ideas? Thanks.

Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
 
get rid of the header commands for the time being and see whether you get anything spat out to the browser.
 
Very interesting idea! No, the documents do not try to load but it is giving some unusual and unexpected results. Word documents seem to hang the browser while Excel documents show my login page as being editable in Excel (not the actual page but an Excel copy), and PDFs do nothing. I have no idea how the login page could possible show as it's on another page and there is no corruption of the files.

Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
 
Ignore what I said about the login page showing. It no longer shows and wasn't part of the problem. With the headers removed both Word and Excel still load the plug-in but PDF does not.

Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
 
The way this is behaving, and taking into account the fact that the JavaScript WYSIWYG plug-in in another part of the site is also showing as empty, I think these Word and Excel files are actually loading and that for some reason their contents are just not visible! Whether it's some security issue that is particular to the PHP upgrade or something else is still a mystery. Whatever is wrong with the PDFs seems to be unrelated or not related directly.

Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
 
if you change the mime type to application/octet-stream, do the files download ok to the browser? (so that you can save and then edit them?) if so, then it would seem to be your plugin at fault (except that the files should still be readable - try grabbing the file contents into a string and dumping that to the browser)

Code:
$contents = file_get_contents($OriginalDoc);
echo $contents;
 
Hmmm. Setting $MimeType to application/octet-stream made no difference and file_get_contents($OriginalDoc) just opened an empty browser (no plug-in). I also tried:

Code:
ob_start();
	$contents = ob_get_contents($OriginalDoc);
	echo $contents;
ob_end_clean();

but it also opened an empty browser.

Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
 
the output buffering would not have worked. i don't think ob_get_contents can take an argument.

which makes me wonder. php should have barfed at that code you posted. you do have error_reporting set to E_ALL and error_display set to on in your php.ini, don't you?
 
This is a fresh install of PHP and not everything that can be enabled has been enabled unless I was sure of the outcome.

That said, error_reporting = E_ALL but and log_errors=On but display_error=Off (I just changed to On). I am not sure where it saves its log files to see if there are any clues there.

Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
 
remember to reboot the webserver after changing php.ini.
you should get some error messages now. they should be useful in debugging.
 
When I turned on the local development system this morning and loaded the site, the documents are loading too! I am not sure why as I had rebooted several times yesterday too. The WYSIWYG editor is still empty but that's clearly another issue. Unless you can think of anywhere to start on that, thanks a bundle for all the help!

Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
 
start a new thread on the wysiwig issue i'm sure we can work it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top