Page 1 of 1

Code gives blank page

Posted: Sun Dec 12, 2004 8:53 pm
by St8ic
Apache
PHP5 (and 4)
Trustix Linux (and OpenBSD)
Safemod off
phpinfo(); works perfectly

I've tried three different PHP scripts on two different versions of PHP and two different operating systems. No matter what, my PHP scripts return a blank page. Do you have any ideas?

Posted: Sun Dec 12, 2004 8:57 pm
by Benjamin
I have seen that happen when there is a fatal error in the script. I can't remember how to fix it, but you may want to change error reporting to E_ALL and see if that helps.

Posted: Sun Dec 12, 2004 9:03 pm
by rehfeld
what happens when you put this into its own file

Code: Select all

<?php

echo 'i was output using echo';

?>
<br>
i was output directly
it should work perfectly if phpinfo() worked.


like said above, you prob have an error in your script, and dont get an eror because you turned error_reporting or display_errors off,

Posted: Sun Dec 12, 2004 9:46 pm
by St8ic
That code (the echo test) worked just like it should.

The strangest thing is that "error_reporting = E_ALL"!

Thanks for the replies, and sorry for being to general.

Posted: Sun Dec 12, 2004 11:03 pm
by St8ic
I had display_errors off. I turned it on, fixed the error, but I still have one problem.

I can't make directories (it says permission denied). Is there an option in php.ini that I could change, or do I have to chmod the directory?

Posted: Mon Dec 13, 2004 12:34 am
by rehfeld
the directory which your are trying to write to must be writable, whether your trying to make a file, or a new directory inside it.

in my experience, if safemode is on, you cant make a directory inside a directory that was created w/ php

eg
mkdir('foo'); // ok
mkdir('foo/bar'); // denied