magicmoose Posted July 2, 2009 Share Posted July 2, 2009 Hi, I'm having some problems with some code I've just tried to upload. At the beginning of the code, I include a bunch of classes, each of which start with declerations, eg public $something private $something protected $something etc Everything works fine on my local machine, but when I upload it, I get errors like: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /usr/local/psa/home/vhosts/mysite.com/httpdocs/test/classes/page.php on line 4 If I change the public/protected/private etc to var, the errors stop, but surely this isn't good practice. Can anyone tell me what's going on? Thanks. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 2, 2009 Share Posted July 2, 2009 Your web host is still running php4. You are trying to use php5 syntax. You need to switch your hosting to php5. You can usually do this through your control panel, a change in a .htaccess file, or by changing file extensions (check with your web host exactly how to do it on their servers.) The end of life of php4 was more than one and a half years ago, there is no excuse for any host or programmer to still be using php4. Quote Link to comment 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.