MasterACE14 Posted January 19, 2008 Share Posted January 19, 2008 Hey Everyone, I keep getting Parse error: syntax error, unexpected $end in /home/ace/public_html/darkdestiny/adodb/adodb.inc.php on line 428 when using ADOdb(used for connecting to different types of databases, im using it for mysql) on my webhost, but it works completely fine on my localhost, now the problem is, my localhost runs the latest version of PHP, but my webhost uses version 4.7.7 and thus seems to be creating this parse error. Now I am fairly confident there is a way, or function that can force a script to run in a lower version of PHP, could someone supply me with this function or a sample script to force the version. any and all help is greatly appreciated Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/ Share on other sites More sharing options...
AndyB Posted January 19, 2008 Share Posted January 19, 2008 The error message is symptomatic of an unclosed loop, i.e. a missing } and it's nothing to do with the php version. Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443375 Share on other sites More sharing options...
MasterACE14 Posted January 19, 2008 Author Share Posted January 19, 2008 I've looked over the file, and had a friend look over it, and can't see it missing a } :-\ its strange how it works perfeclty fine on localhost and not on my webhost :-\ Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443377 Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 Try to attach the file and let us take a look. Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443378 Share on other sites More sharing options...
PFMaBiSmAd Posted January 19, 2008 Share Posted January 19, 2008 I'll echo what AndyB just posted. This is due to a php configuration difference and has nothing to do with php versions. It is probably due to short open tags being used in your code. When this error occurs when the only thing that changed is a different server, then it is probably due to a block of php code that is using short open tags that contains the missing }. When the server does not recognize the <? tag then the } that is in that block of code is not seen either. I seriously recommend to anyone that is using the lazy-way short open tags <? or <?= to change these to <?php and <?php echo to avoid problems. Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443380 Share on other sites More sharing options...
MasterACE14 Posted January 19, 2008 Author Share Posted January 19, 2008 I'll echo what AndyB just posted. This is due to a php configuration difference and has nothing to do with php versions. It is probably due to short open tags being used in your code. When this error occurs when the only thing that changed is a different server, then it is probably due to a block of php code that is using short open tags that contains the missing }. When the server does not recognize the <? tag then the } that is in that block of code is not seen either. I seriously recommend to anyone that is using the lazy-way short open tags <? or <?= to change these to <?php and <?php echo to avoid problems. open tags isn't a problem with this script. Try to attach the file and let us take a look. heres the area around the line it says the error is on(sorry cant attach it :-\ ): <?php function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false) { if ($argHostname != "") $this->host = $argHostname; if ($argUsername != "") $this->user = $argUsername; if ($argPassword != "") $this->password = $argPassword; // not stored for security reasons if ($argDatabaseName != "") $this->database = $argDatabaseName; $this->_isPersistentConnection = false; if ($forceNew) { /* line PHP has a problem with */ if ($rez=$this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; } else { if ($rez=$this->_connect($this->host, $this->user, $this->password, $this->database)) return true; } if (isset($rez)) { $err = $this->ErrorMsg(); if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'"; $ret = false; } else { $err = "Missing extension for ".$this->dataProvider; $ret = 0; } if ($fn = $this->raiseErrorFn) $fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); $this->_connectionID = false; if ($this->debug) ADOConnection::outp( $this->host.': '.$err); return $ret; } ?> Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443405 Share on other sites More sharing options...
MasterACE14 Posted January 19, 2008 Author Share Posted January 19, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443478 Share on other sites More sharing options...
revraz Posted January 19, 2008 Share Posted January 19, 2008 If you want help, post all 428 lines of code. Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443492 Share on other sites More sharing options...
PFMaBiSmAd Posted January 19, 2008 Share Posted January 19, 2008 That would be the only way to get help. The error means the parser got the end of the file and did not find matching { }. Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443517 Share on other sites More sharing options...
tinker Posted January 19, 2008 Share Posted January 19, 2008 It was a long time ago so I don't remember the actual error, however I had extra blank lines after my closing tags and the server started trippin and I had to delete all extra space and lines, I think that was something to do with 'end'... maybe worth a try? Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443544 Share on other sites More sharing options...
MasterACE14 Posted January 19, 2008 Author Share Posted January 19, 2008 here's the complete file, its very long. http://crikeygames.com.au/filesharing/adodb.inc.txt Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443782 Share on other sites More sharing options...
MasterACE14 Posted January 19, 2008 Author Share Posted January 19, 2008 as far as I can tell there is nothing wrong with the file at all :-\ Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443812 Share on other sites More sharing options...
Daniel0 Posted January 19, 2008 Share Posted January 19, 2008 I can't see anything either. Are there any newer version? It said @version V4.94 23 Jan 2007 so the version you have is almost a year old. Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443817 Share on other sites More sharing options...
MasterACE14 Posted January 19, 2008 Author Share Posted January 19, 2008 good point, I'll check for a newer version now Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443818 Share on other sites More sharing options...
PFMaBiSmAd Posted January 20, 2008 Share Posted January 20, 2008 Either one or more of the files that are part of the adodb package got truncated/corrupted when they were uploaded to the server or something in your main file that is including the adodb.inc.php file is causing the error. Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443898 Share on other sites More sharing options...
MasterACE14 Posted January 20, 2008 Author Share Posted January 20, 2008 I just went and downloaded the latest ADOdb compatible for PHP 4 and 5, and uploaded all the files, Either one or more of the files that are part of the adodb package got truncated/corrupted when they were uploaded to the server or something in your main file that is including the adodb.inc.php file is causing the error. 5 of the files weren't fully uploaded and I was notified by FileZilla. I then created a basic upload.php file to upload the 5 files(and not setting a file size restriction) and that seemed to upload the complete files. But I am still getting a $end, but now it is at line 1663. any ideas?? Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443900 Share on other sites More sharing options...
MasterACE14 Posted January 20, 2008 Author Share Posted January 20, 2008 I've just tried all the test files that came with adodb. and when I run them I get the same $end error :'( Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443901 Share on other sites More sharing options...
PFMaBiSmAd Posted January 20, 2008 Share Posted January 20, 2008 The file in question has 4200+ lines. The file size is only 119kb. You need to use some other more reliable method of uploading the files. Are the files intact after you un-compress them, before they are uploaded? Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443904 Share on other sites More sharing options...
MasterACE14 Posted January 20, 2008 Author Share Posted January 20, 2008 Got it! , I tried using my other computer, with my higher speed broadband, and that uploaded the complete file, it is now working magnificently! Thank you everyone for your help! much appreciated Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/86750-solved-unexpected-end-server-has-lower-version-of-php-then-my-localhost/#findComment-443908 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.