You are not logged in.

#1 2012-03-31 23:04:40

holland01
Member
Registered: 2011-12-22
Posts: 50

Getting owned by PHP on Localhost.

For some reason, PHP is refusing to display ANY output whatsoever. I have error reporting, output buffering, session.auto_start, etc. all enabled, and neither of these seem to be doing the trick. I've followed the following guide so far:

https://wiki.archlinux.org/index.php/LAMP

I was able to set it up, working perfectly (with MySQL), and no problems in terms of my test.php file which simply outputs the `phpinfo()` function. However, when I try to do a `var_dump( $res )` on anything, or an `echo`, or whatever, I'm lost as to what can be done.

code from test.php (which is different than the one which outputs `phpinfo()`):

<?php

//error_reporting( E_ALL );

include_once( 'includes/database.php' );

use includes\Database;

$database = new Database( 'evolve_admin' );

$res = $database->fetchRow(
	'evol_users', 
	array( 'user.id', 'user.email', 'user.firstname' ), 
	array( 'user.email' => 'test1234@test.com' )
);

var_dump( $res );

echo __LINE__;

?>

Thus, I'm not sure exactly what to do about this. Could someone help me out here?

Last edited by holland01 (2012-03-31 23:25:07)

Offline

#2 2012-03-31 23:10:28

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Getting owned by PHP on Localhost.

var_dump returns a string, it does not print on its own.

Offline

#3 2012-03-31 23:19:39

holland01
Member
Registered: 2011-12-22
Posts: 50

Re: Getting owned by PHP on Localhost.

Right, but the issue is that it doesn't print/output anything - not even a string. Period. If you look at the code, you'll see I'm trying to print `$res`, which is, in fact, not even outputting `(NULL)`, which should be the case.

Last edited by holland01 (2012-03-31 23:25:56)

Offline

#4 2012-04-01 00:15:55

kulpae
Member
From: Bremen
Registered: 2010-02-06
Posts: 34

Re: Getting owned by PHP on Localhost.

no, var_dump returns nothing. it `prints` to the output buffer directly.

Are you sure there are no output-control functions called in database.php or so?
Try calling 'ob_end_flush()' after 'echo __LINE__;'

Offline

Board footer

Powered by FluxBB