0

Can someone please tell me what the error is in the following script? Was forced to update to php 5.3 instead of 4 and now site is down

<!--form action : <?=//MYSURL_DEV?>properties_features.php-->
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592

1 Answers1

0

You should check your php.ini to see if short tags are enabled. They are often disabled by default. As of PHP 5.4 short tags are always on, but not so on PHP 5.3 and lower.

If you're able, in php.ini you'd enable this with:

short_open_tag = On

Be aware thought that in some hosting environments you actually may be prevented from enabling the use of short tags. And even though 5.4 has them always available, they are generally not recommended because of the very issue that you may have encountered: you may move to another environment that doesn't have them enabled (or even allow it).

The alternative is to use:

<?php echo $var; ?>

More info can be found here: Are PHP short tags acceptable to use?

Community
  • 1
  • 1
tptcat
  • 3,894
  • 2
  • 32
  • 51
  • this is all i have in my php.ini file-thank you register_globals = off allow_url_fopen = off expose_php = Off max_input_time = 60 variables_order = "EGPCS" extension_dir = ./ upload_tmp_dir = /tmp precision = 12 SMTP = relay-hosting.secureserver.net url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" [Zend] zend_extension=/usr/local/zo/ZendExtensionManager.so zend_extension=/usr/local/zo/4_3/ZendOptimizer.so – user1615674 Aug 22 '12 at 01:49
  • Did you read my answer and attempt to add `short_open_tag = On` in your php.ini file? Also, are you on shared hosting? If so, do a search to see if your hosting provider allows you to use this setting in php.ini. – tptcat Aug 22 '12 at 01:51
  • this is the error i get on my website Parse error: syntax error, unexpected ';' in /home/content/l/a/r/larealtor4u/html/oceanaveliving/header.php on line 101 – user1615674 Aug 22 '12 at 01:56