Reputation: 7215
So I have a strange and quite ambiguous question, which I can't seem to find even a vague answer to anywhere on the internet.
I've written a bunch of classes which facilitate a checkout process. The entire process works perfectly fine on my development server, but when I upload it to my client's server the code dies about halfway through (I can tell because I know which actions were and were not performed).
Debugging the code on my development server yields no warnings or errors (and rightly so, since it WORKS locally).
When running the website on the remote server, the code dies with '?>' as the only output. There's just way too much code to post in here, and I can't narrow it down to a specific line or even file, since I don't get any error output (and as I mentioned above, debugging it is of no use because it runs fine in the location for which I have access to a debugger).
So tldr; my question is: Is there any generic reason for why this ?> might be echoed to the page? The nature of this text suggests that it's terminating and for some reason printing the PHP ending terminator tag?
I have no clue. I understand that this problem is very hard to diagnose with what I've given you (and it's all I have to go on, as well) but even the slightest idea or suggestion would be infinitely helpful.
Thanks!
Upvotes: 2
Views: 305
Reputation: 507
I don't know if you are using zend, but they recommend not having a closing php tag in php only files (like classes) http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html
Maybe deleting the closing php tag will allow you an error message that will lead to the real problem.
Upvotes: 0
Reputation: 96266
You're using the url path /
and the web server fetches index.html or something similar and not index.php. Try to directly access it.
Upvotes: 0
Reputation:
When in doubt, you can use some echo statements to help see just how far the code is getting. Perhaps you've got a quote mark out of place somewhere, causing the page to actually just print that part of the code. Or maybe you've already terminated the PHP somewhere, and then you write ?> again without needing to.
In terms of that being an actual error message though, I doubt it. My money's on some erroneous character(s).
Upvotes: 0
Reputation: 43243
Sounds to me that you've used short open tags (<?
or <?=
), and it's disabled in your production environment.
You can find out if this feature is disabled by checking the short_open_tag
PHP configuration option.
Upvotes: 8