Reputation: 1008
I have a program which runs well on IDE and echo's successful with no errors.
But if the same program when run on a browser like firefox or chrome doesn't show up anything.
Its just a blank page.
Is there anything that i need to add in script to run on Browser or i am doing anything wrong?
Upvotes: 0
Views: 72
Reputation: 9148
There are many reasons your script could be choking when served from a webserver. ... You do have a webserver working properly and able to run other scripts, right?
Make sure error reporting and error handling is properly set up to display errors. Add this snippet at the top of your script if you want a quick and dirty way of doing this.
error_reporting(E_ALL);
ini_set('display_errors', '1');
Check webserver is working ok with other script
Use a debugger, if you have one ...
2.a If you don't have a debugger, here is a quick poor-man-debugger's tutorial: add an exit;
in your script where you know it should output something, then use avar_dump
if necessary just before the exit to see if your expectations match the output. Repeat with the next instruction, until you get to the point where the output in var_dump does not match what you expect.
On a friendly side-note, next time you post, please give more details or even a code snippets or two of relevant code. This will bring you much more specific and relevant answers.
Upvotes: 1