PHP pages are displayed as blank pages
I recently compiled Apache 2.2.8 and PHP 5.2.5 from source and did everything as in the official PHP documentation. The weird thing is that I've got blank pages on almost every PHP page. One script works and I don't know how it's possible. I used to run nginx before, but I removed it. The Ubuntu packages also don't work.
My httpd.conf is the default one with PHP enabled. My php.ini is the default php.ini-recommended. How can I fix this weird behavior? |
Use:
Code:
short_open_tag = On |
I'm using my own scripts and I'm aware of the short_open_tag variable, so I use the <?php open tag. Anyway, I tested it and it doesn't work.
If I create a phpinfo script, it works. If I run a more complex script like Code:
<?php |
check the apache log file for hints; I don't have access at the moment to my slackware server, but somewhere in /var/log/
//edit: you start with PHP open tag; if something goes wrong in that first part (before you get to the html part), apache might/will abort resulting in blank page |
Ok, it seemed to be a stupid question. I had display_errors turned off in my php.ini and my scripts are spawning errors so I've got blank pages as result. Thanks anyway!
EOT |
that'll do it every time!
If you have php installed for use from the command line, you can also try to run your scripts by the invocation php myscript.php. If you get html text output, you are good to go. Otherwise, you will get descriptive error messages, regardless of what the PHP plugin to apache is configured to do. Also, if you have php available at the command line, then starting a script with shebang php lets you run scripts written in php exactly the same way you run perl scripts or bash scripts. Specifically, on my system, if the first line is: #!/usr/bin/php then I can execute php scripts like any other command. |
Quote:
If this is a production server, it should be off for security reasons. Under other circumstances (e.g. development), it's up to you. |
All times are GMT -5. The time now is 10:08 PM. |