Welcome Guest, Not a member yet? Register   Sign In
First line is a blank line
#1

[eluser]ripken204[/eluser]
If I view the source on all 3 of my CI websites, I notice that the first line is blank.
All of the sites are using 2.1.0 or newer.
The sites are all on different servers and each server is running nginx, not sure if nginx could be the issue.

This really became apparent when I was just trying to code something that outputs to a CSV file using $fp = fopen('php://output', 'w');
When I do this, the first line of my CSV file is blank and by header row is at row 2 instead of row 1.

Does anyone know how to fix this or what is causing it?
It's probably something to do with how CI handles output buffering.
#2

[eluser]Eric Barnes[/eluser]
It shouldn't have a blank line at the start of any php files. If you view the source on github you can confirm no files have this space. So maybe something on your ide or system when you are downloading?
#3

[eluser]ripken204[/eluser]
I don't think it's the IDE, one of the sites I primarily used geany and the other two sites I primarily used notepad++

I think I will just test it out an a server running apache just to rule out nginx or something in my nginx config. I actually hope that is the problem since I have no idea what it could be.

I have not modified the CI system files at all and I even tried making a single controller that does nothing put echo "Hi!" and it still has this issue

EDIT: apparently it was geany's fault. it added a new line to the end of my constants file... and that was an issue on 3 of my websites since I typically cope code from one project to another. It's also because I had a closing php tag at the end.. If I didn't close my files like the CI system files do then it wouldn't have been a problem.




Theme © iAndrew 2016 - Forum software by © MyBB