PHP script fills browser with question marks

Problems with the Linux version of XAMPP, questions, comments, and anything related.

PHP script fills browser with question marks

Postby naudefj » 31. January 2009 14:30

I've successfully installed the FUDforum software with XAMP 1.7.0 on Windows, however, when I try the same on XAMPP 1.7.0 for Linux, the browser window just fills with question marks.

There are no PHP errors and "php -l install.php" returns "No syntax errors detected".

Any suggestions on where to start looking for the problem?

Best regards.

Frank
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21

Re: PHP script fills browser with question marks

Postby Wiedmann » 31. January 2009 19:24

Any suggestions on where to start looking for the problem?

Ask the FUDforum support?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: PHP script fills browser with question marks

Postby naudefj » 31. January 2009 19:41

Well, the same script is working on XAMP for Windows, so I reckon the problem is with the Linux port of XAMP.

PS: I'm not the only one with this problem. Here's a similar discussion (without resolution) on the FUDforum site - http://fudforum.org/forum/index.php?&t=msg&th=4633

Best regards.

Frank
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21

Re: PHP script fills browser with question marks

Postby Wiedmann » 31. January 2009 19:52

so I reckon the problem is with the Linux port of XAMP.

Only a FUDforum developer can told you, in which case the script is just outputting "?????".

(Or someone other who is looking through the code.)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: PHP script fills browser with question marks

Postby naudefj » 31. January 2009 20:41

The question marks are not in the script.

I've just installed php separately on the same system, and it worked perfectly. So, XAMP on Windows is good and PHP 5.2.6 stand-alone is good. I even have it working on a server with PHP 5.1.6. The exception is XAMP for Linux!
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21

Re: PHP script fills browser with question marks

Postby naudefj » 01. February 2009 07:36

OK, here is a small test case to simulate the problem:
Code: Select all
<?php
/* �[34m^G~Nظ^@~P~N�^@^A)�)����[34m^Y^@^@
 * First 20 bytes of linux 2.4.18, so various windows utils think
 * this is a binary file and don't apply CR/LF logic
 */
echo "Hello world\n";
?>


Working with normal PHP:
Code: Select all
# /usr/bin/php x.php
Hello world


Broken with XAMPP for Linux's PHP:
Code: Select all
# /opt/lampp/bin/php x.php
??????�???????????????????????????????????????????????????????????????????????????????????
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21

Re: PHP script fills browser with question marks

Postby Wiedmann » 01. February 2009 12:03

Well, I don't know why there is a difference behavior with XAMPP, but the problem is this curious 1st line in the remark.
--> Thus, just remove this line, an the script should also work with XAMPP.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: PHP script fills browser with question marks

Postby naudefj » 01. February 2009 14:35

It's not that easy, the script contains more binary data (the files that must be extracted) below the following section:

Code: Select all
<?php exit; ?>
<?php __HALT_COMPILER(); ?


This is all valid PHP code. It's strange that XAMP for Linus chokes on it, while all other PHP installations (including XAMP for Windows) works just fine. I would appreciate if a bug can be opened for it.
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21

Re: PHP script fills browser with question marks

Postby Oswald » 01. February 2009 15:52

Hi Frank!

Can you please send me the PHP file in an email to oswald@apachefriends.org.

Greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Re: PHP script fills browser with question marks

Postby Oswald » 02. February 2009 16:40

Hi Frank!

Thanks for the file. It's because of a NULL character (shown as ^@) in the PHP code.

I assume(!) it's a problem with PHP mbstring extension for multi-byte string support. Sadly in XAMPP for Linux this extension is compiled in and can't be disabled. But - as far as I know - on Windows you may disable this extension. @Wiedmann: Do you know if it's a shared extension in XAMPP for Windows?

Greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Re: PHP script fills browser with question marks

Postby naudefj » 02. February 2009 16:58

Good spot! What's strange is that the NULL doesn't even have to be in the PHP code. This example gives the same error:

Code: Select all
<?php echo "Hi"; ?>
/* ^@ */
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21

Re: PHP script fills browser with question marks

Postby Oswald » 02. February 2009 17:03

Hi Frank!

Yes, it IS strange.

And I just found that Sun's Cool Stack has the same problem: http://forums.sun.com/thread.jspa?threadID=5305046 But according to them it's not an mutibytestring issue.

Greetings
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Re: PHP script fills browser with question marks

Postby Wiedmann » 02. February 2009 17:42

@Wiedmann: Do you know if it's a shared extension in XAMPP for Windows?

"mbstring" is a shared extension, and it's enabled in "XAMPP for Windows".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: PHP script fills browser with question marks

Postby naudefj » 09. February 2009 15:56

I hope you guys be able to fix this problem in a subsequent release. XAMPP is a great distributions and I would love to use it on Linux as well.
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21

Re: PHP script fills browser with question marks

Postby naudefj » 09. May 2009 07:19

The solution to this problem is to edit your php.ini file and set detect_unicode to Off.

Fore more details, see http://bugs.php.net/bug.php?id=36711
naudefj
 
Posts: 8
Joined: 31. January 2009 14:21


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 10 guests