davidp Posted April 4, 2007 Share Posted April 4, 2007 Here at work we just updated to PHP 5.2.1 on our test server. Testing out the web page on there, for some reason the PHP scripts are all breaking. We are getting errors sent back to us from PHP saying it has found an "unexpected $end". Depending on the file it could occur at the very end of the file, or even in the middle of the file. Not sure exactly what is causing this problem. Anyone had this same problem after upgrading to 5.2.1? Quote Link to comment https://forums.phpfreaks.com/topic/45624-problems-upgrading-to-php-521/ Share on other sites More sharing options...
davidp Posted April 4, 2007 Author Share Posted April 4, 2007 I have done some more research since posting that first post, and I have found some interesting things. By reading a thread on phpbuilder, I discovered that most people receive this thread because of their carelessness and they leave out curly brackets. This cant be our problem, however. We have been using this code faithfully for a long time now, and have received no such errors in the past...surely those would have already been caught since our code has been running on production servers for quite a long time. The other case where people seem to be receiving this error (a bit less common) is in their php configuration (php.ini file), the short_open_tags flag is not turned on. In other words, the server is set to not be able to recognize short open tags, or <? tags. But only <?php tags. I decided that this could possibly be our problem, and so I checked out the php.ini file, only to find that short_open_tags was set to the value "On"...so they should be allowed perfectly fine. After toying around with the code...I place "<?php" tags in place of all "<?" tags...and suddenly things worked...which is odd considering that short_open_tags was enabled. With that in mind...if I make a very simple php file: <? print 'Hi!'; ?> with short open tags...it works... So I know the problem seems to be with short open tags....but I cannot pinpoint it exactly. Under that new light and knowledge...any advice? Quote Link to comment https://forums.phpfreaks.com/topic/45624-problems-upgrading-to-php-521/#findComment-221619 Share on other sites More sharing options...
kenrbnsn Posted April 4, 2007 Share Posted April 4, 2007 Without seeing the code that caused the problem, we really can't make an intelligent guess. Ken Quote Link to comment https://forums.phpfreaks.com/topic/45624-problems-upgrading-to-php-521/#findComment-221641 Share on other sites More sharing options...
davidp Posted April 5, 2007 Author Share Posted April 5, 2007 If you want to sort through about 50 php files all experiencing the same problem, be my guest Quote Link to comment https://forums.phpfreaks.com/topic/45624-problems-upgrading-to-php-521/#findComment-221712 Share on other sites More sharing options...
kenrbnsn Posted April 5, 2007 Share Posted April 5, 2007 Find a simple example that illustrates the problem and post that. Of course, finding the simple example might give you enough information to solve it. Ken Quote Link to comment https://forums.phpfreaks.com/topic/45624-problems-upgrading-to-php-521/#findComment-221719 Share on other sites More sharing options...
wildteen88 Posted April 5, 2007 Share Posted April 5, 2007 I noticed you mentioned about short tags There is another short tag with is <?= that is short for <?php echo. Have you converted those tags too? Quote Link to comment https://forums.phpfreaks.com/topic/45624-problems-upgrading-to-php-521/#findComment-222019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.