NameSilo

PHP page blank; no errors generated

Spaceship Spaceship
Watch
Impact
111
Hey all,

I don't usually post here for help... so I feel kinda awkward doing this. Please be nice :)

I have Apache running PHP and MySQL on my local workstation to make dynamic sites without the need to upload them. It works fine, never had any problems, haven't changed anything since 3 weeks ago, and everything's been good with it. So the server/config is not the problem.

It's one particular file that I have which shows up completely blank. Nothing is even outputted to the source. There's no 404 error, there's no PHP errors, and there's no logical errors. I didn't really change anything; and just to double-check it, I added:

echo("Test");

to the beginning of the file to see if it was even working. It's not. So I remove the ; at the end to see if it'll output a syntax error, like it always has. No errors. I haven't changed any config, as I said. Everything is like it always has been. And YES, it's configured to output all standard errors.

And it's just this one file.

I can't show you what's in the file for security reasons, but it's something that I really need to get fixed... any help appreciated.

Thanks,
-Matt
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Is your Apache working previously? It seems like you got to check the Apache log file and see what's it is complaining about :)
 
0
•••
tanfwc said:
Is your Apache working previously? It seems like you got to check the Apache log file and see what's it is complaining about :)

Exactly what i was going to suggest. Failing that try reloading Apache (and subsequently php).

Definitely sounds like a server problem.

Matt
 
1
•••
Hmm... I didn't think to check the server logs, however:

Apache .log file said:
[Sat Feb 24 17:27:37 2007] [notice] Parent: Created child process 5628
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Program Files\\PHP\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
[Sat Feb 24 17:27:38 2007] [notice] Child 5628: Child process is running
[Sat Feb 24 17:27:38 2007] [notice] Child 5628: Acquired the start mutex.
[Sat Feb 24 17:27:38 2007] [notice] Child 5628: Starting 250 worker threads.
[Sat Feb 24 17:27:38 2007] [notice] Child 5628: Starting thread to listen on port 80.

Today is Sunday, though. Do you think it could have anything to do with it? If so, why does it only affect one file? It's just like others I have which work fine.

EDIT: I also see this happened previously several times... but the server restarts just fine. I'm not sure why it's not giving me any errors on restart like this.
 
0
•••
chulium said:
Hmm... I didn't think to check the server logs, however:



Today is Sunday, though. Do you think it could have anything to do with it? If so, why does it only affect one file? It's just like others I have which work fine.

EDIT: I also see this happened previously several times... but the server restarts just fine. I'm not sure why it's not giving me any errors on restart like this.
If you suspect it is your script having problem, put this at the top of the code

Code:
error_reporting(E_ALL);

It SHOULD throw you error message now :)

If not, run your script through console (best place to debug stuff).

Code:
c:\PHP\php.exe <full_path_to_script>

Of course, change the php.exe path to your install directory :D
 
1
•••
You may have to check your PHP.ini file. There is one line which says whether to display errors or not. On production sites this setting is often set to Off.
 
1
•••
Thanks again for more help, but nothing there works. Like I've said, errors ARE outputted and configured correctly. All other files work, show errors, etc, except this particular one.

EDIT: I'm giving rep to those that try to help :) Thanks.
 
0
•••
The log shows that PHP couldn't load the exif extensions. Are you calling any exif functions in the script?

Also, try commenting out the entire contents of the script so that you only have your Test echo as the script body:

PHP:
<?php
    echo 'Test';
?>

If that works, try adding things back in in blocks until it starts working again. If it doesn't...well...bad disk sectors maybe?

Also --and this might sound weird-- did you cut and paste any of the code from somewhere else? Sometimes this copies hidden characters which get embedded in the script (for example, this happens to me sometimes when cutting and pasting source from a .chm file). You might have to retype the code by hand, or strip all bad characters from your source file (most program editors have a way to do that).

And of course, last bit of advice for windows -- did you reboot the entire machine? (only half joking here).
 
0
•••
Tried the echo thing, the removing/adding blocks of code thing, and all the code is original.

Oh well, thanks for the help. I'll just re-write the file or something.
 
0
•••
It is difficult to say without seeing the full code. But I can tell you that PHP has some bugs. The version you are using could be at fault. Could it be that you are using a particular function in that page ? ;)
 
0
•••
Possibly :( Thanks for all your help ... I'll just rewrite it and avoid some methods I used in this file.
 
0
•••
Can i suggest uploading it to a live server to actually determine if it is your local setup or not?

You could be saving yourself a lot of hassle...

Matt
 
0
•••
If I didn't remember wrongly, if a PHP module fails to load, PHP wouldn't load as well.

If you're completely not getting ANY output, you might want to check if PHP is actually running by using another script.

EG. <?php phpinfo(); ?>
 
0
•••
PHP *IS* RUNNING. It's only one file that has the problem! How can I not make myself clearer??

Regardless, I fixed the problem.
 
0
•••
chulium said:
Regardless, I fixed the problem.

I think we're all dying to know...HOW???
 
0
•••
Oh, sorry.

I had missed a ] to close an array index.

The error_reporting(E_ALL); at the beginning of the file didn't seem to work, as previously stated...

I get parse errors on every other file except this one, which didn't use any EXIF functions either.

So yeah, I dunno what happened. But it's fixed; that's all I care about. Thanks for the help.
 
0
•••
display_errors and error_reporting php directives may have overrided script settings.
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back