HELP! I HAVE A BLANK PAGE!! – errors defined
So you just spent hours working on adding some plugin or addon to your website, and you save, and then go to see your handwork and your heart sinks – or maybe you feel like you are going to throw up, or throw your computer.. Well, don’t worry. Or at least, don’t start worrying until you have checked out a few things.
Generally, when you end up with a blank page, it is simply because in your host’s control panel, the function of error reporting is turned off. There is a good reason to have error reporting turned off, but it definitely should not be turned off if you are working on something. To turn on error reporting yourself, you will have to add this code to your .htaccess code
php_flag display_errors on
php_value error_reporting 6143
Error reporting is simply the ability for a browser to display errors in your website. This is invaluable as a code breaker like myself, because errors tell you a lot about what you did wrong. For instance, if you get the following error:
Fatal Error: can not redeclare …………………………….. previously declared on …..
This means that whatever function that is explained here has already been declared. Declared kind of means DEFINED, and a function is just that, a function. So if your website has a function that shows the categories box in your oscommerce store, and you copy and paste the code for that into the header so that you can have categories in your header too, you will have the same function delcared twice, hence this error. The lovely thing, it tells you where the error is, and where it was declared previously. From there, you can delete one of the two, or rename the function by putting a 2 at the end; like this: functionname2 and then go to where the function is being called from, and rename that one function2 as well.
Parse error: parse error, unexpected T_STRING in ………. on line ….
This is an error that is not as easy to define. A parse error means that there is likely something wrong in your syntax. That can mean anything from a missing curly bracket, semicolor, or quotation mark. As a newbie coder, you might need help. You can try and help yourself by looking for code within your own website that is similar to the one that you were working on, and compare it. For instance, when I first started, I was trying to add a new link in my header, but I wanted to use the proper php syntax using (tep_href_link) but it is a lot more complicated that linking using HTML. So what I did was find a place where I knew there was a good example of a link (in the header where the banner is) and copied it and pasted it where I wanted. Then I just changed the text and/or the name of the image.
**you should note that the line number stated in the error is not always where the error or missing piece of code actually is. generally if the error is not on that line, it means that you missed a curly bracket somewhere within that code.
Warning: Cannot add header information – headers already sent by (output started at /…………….:9) in….
This is the absolutely most simple error to fix – usually. It is generally caused by a white space at the beginning or the end of your code. HTTP headers must be sent before any output from your code, which means that a header function must be placed before any html or even a white space. So generally, you fix this by looking for an empty space before the first <?php tag or after the last ?>. You do this by putting the cursor at the tag, and deleting any white space before/after it. There should not be one single space or line before the first and after the last.
Warning: main(/index.php): failed to open stream: No such file or directory in…
This error simple means that the file mentioned does not exist in the directory that it is calling it from. It will tell you where in the code the file name is being called from, and where it should be. This is a pretty self explanatory fix. You need to either check and see if the file is there, or if the file name was typed incorrectly.
Other common errors that you see especially in oscommerce stores are from the database. The php code generally is trying to get information from a table inside of you database, but if those tables do not exist you will get errors like these:
1064 – You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ products_id from orders_products where orders_id = ‘70” at li
select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from, products_id from orders_products where orders_id = ‘70′
[TEP STOP]
This means that the code in your files that literally look exactly the same as this one is wrong. Each addon or installation will have different values listed for the tables. The second paragraph tells you all of the database tables that the code is trying to access. If you want to try and troubleshoot this error for yourself, you can log in to phpmyadmin on your host’s control panel, and click on your database. Then you will look for the tables with those names. They are organized very nicely and if you are familiar at all with excel and spreadsheets, you should be able to figure this out. If the tables exist, there might be some other error. If those tables do not exist, then that is your problem and you likely missed a step somewhere. It also could be the syntax in which you are trying to call for the database that is throwing this error, so it could likely be more complicated.
There is also the error that tells you that the tables do not exist, and these look like this:
1146 – Table ‘db_dbname.orders_status_history_transactions’ doesn’t exist
INSERT INTO orders_status_history_transactions ( `orders_status_history_id`, `transaction_id`, `transaction_type`, `payment_type`, `payment_status`, `transaction_amount`, `module_code`, `transaction_avs`, `transaction_cvv2`, `transaction_msgs` ) VALUES ( 328, ‘1JV740438A749591H’, ‘CHARGE’, ‘INSTANT’, ‘COMPLETED’, 36.87, ‘paypal_wpp’, ‘Yes Address and five-digit ZIP’, ‘Match CVV2′, ” )
[TEP STOP]
This is similar to the last one I mentioned in that it is tell your specifically that those tables do not exist, and you missed a step somewhere. Likely, if you were installing an oscommerce addon, you did not input the mysql “code” or you did not import the file to have the code run. If you do not know how to do that, keep and eye out. I will write a quick tutorial on how to do this.
So the moral of the story is… read. If you simply take your time and read your code, instead of instantly copying it and pasting it into a help forum screaming PLZ HELP!!!! you will teach yourself more about the inner workings of your website, and you will learn how to fix your own errors! Breaking the code is how I learned about this stuff, so dont worry if you break it – just always keep a backup!
***also remember to remove error reporting when your store is live. If you keep it on and an error shows, it can give a possible hacker some deadly information like the name and location of various information in your database. ***


It’s funny but I know all this and I still get problem sorting it out – perhaps a lot has to do with having the answers written down in a fault finding guide like this one
Yup, I encounter this all the time and it always takes me like 20 minutes to figure out how to fix it even though I do it often enough to remember the problem by now.
Hello, I’m having this problem.. but w/ asp.net.
You say the “blank page”is because the error reporting is off… but… when my site has an error (a C# error) it actually throws an exception and I can see the error message.. so I’m guessing this is another error reporting property that handles other kind of errors… (hoping is the same issue I have in asp.net than the issue w/ php) do you think I have the same issue??
Hm.. I am not very familiar with asp.net or C#, but I do believe there are different error reporting tools. You could be seeing your C# errors, but not your php errors. have you called your hosting company to ask about this?
I would still follow the above explaination by first contacting your hosting company to see if your website is hiding the php errors.
Yeah..well… I don’t think is a php error… because I’m not using php at all.. but I’m getting this blank page… without any error message… I don’t think my problem is the “error reporting is off”.. because with other errors I get error messages. (I could be wrong)
I think is something about timeout but not sure.. anyway… I’ll keep looking… thanks!
Can you post a link to the page where you are getting the error.
So your website is using only asp.net and C#?
Yes, it’s using asp.net and C#…
but, it is an internal web system… so you can’t access it from Internet..
It seems the problem is that a ListBox I’m using has a loooooot of items… but I’m just guessing because I don’t get any error message as I said before..
Ahh ok. Now it makes a little more sense. Are you 100% sure the website uses absolutely NO php at all?? Not even to include a file or to create a list or a contact form?
listbox could be using php, i’m not overly aware of what they do (other than they are a form creation system)
Who is your server administrator? You can at MINIMUM check your error logs, which would report an error even if it is not shown on the screen
Well… the listboxes are from the toolbox of Microsoft .NET, I don’t think they use php.. O.o… my server administrator… well.. the company I work for has their own Servers…
So, I will ask assistence for checking the error logs of the server (hope someone can help me here)…
Thank you!!!
I understand.. if there IS an error causing this blank page and it’s not just a blank page because someone physically erased the code, then there will be some kind of error. You can test it by accessing the page and taking note of the date and time. Then when you review the error logs, look for the log on that time and day and see what error was logged when viewing that page at that time.
it should shed some insight..
make sure to let me know what he says
Well… we don’t get any error in the log.. :s
Anyway, I’ve been told it’s possible a post limit issue…and that a possible solution is filtering the listbox items, so it displays less items…and this way prevent the white page… anyway..I’m working on it
Thank you so much for your help and your interest on it.
The strange thing is that usually a limit problem would show in your logs somewhere. Did you have a look at the actual file? Is there content there?
Wish I could be more help.
Actually I didn’t saw it.. the guy I asked told me he didn’t found anything from the site..
I also tried to catch the error in my page.. but nothing happened…
We did a little test… reducing the number of items in the lists… and seems it worked..
So, I will just add the filters fields in the page and hopefully that would help.
It was nice to “message” you. Thanks a lot for the help!
None of the lookups at this site are working, but they seem to be in business in the event you can figure out what you want. When you try to list products, this is what you get.
Products Products
1054 – Unknown column ‘p.products_id’ in ‘on clause’
select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = ‘1′ and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = ‘1′ and p2c.categories_id = ‘47′
[TEP STOP]
thats a common problem and I might be able to help me if you give me more information. What have you done to try and fix it?? Have you tried googling your error?
http://lmgtfy.com/?q=1054+-+Unknown+column+%27p.products_id%27+in+%27on+clause%27
Since this morning I exactly had the problem of blank page as mentioned in your post. I added your code to the htaccess code and it run again! You helped me so much, I haven´t found this tip in any German blog but here. Thanks Thanks Thanks so much!
You are very welcome! I am happy to have helped