blueboat51 Posted February 12, 2010 Share Posted February 12, 2010 Hi All, I have a script (large) sold to us with no chance of support. It works fine on on a commercial hosting, works fine on my CentOs Box at home spritz's out on another commercial server, The ht,l/Java runs but the php seems to displays on the page (from half wat through). Other PHP runs fine on this site. I've pulled PHPinfo on all and wondering if someone could suggest which server config values i should be comparing for this type of Fault. This is the script http://accelerate.info/searchpro/install.php This is the servers phpinfo.php http://accelerate.info/searchpro/phpinfo.php This is the php code just before it outputs to page with the next red part being where it starts to output to page <tr><td bgcolor="#284465"><img src="img/head_li.gif" alt="" width="29" height="25"><img src="img/i18n/<?php echo $timg; ?>.gif" alt="" width="150" height="25"></td></tr> <tr><td><!-- content --><? if (!$installed) { if ($_GET['step'] == 1) { $step_complite = false; if (isset($_POST['submit'])) { $connect_db = @mysql_connect($_POST['db_host'], $_POST['db_login'], $_POST['db_passwd']); $select_db = @mysql_select_db($_POST['db_name'], $connect_db); if (!$connect_db) $error_msg = $i18n['install']['error_db']; elseif (!$select_db) $error_msg = $i18n['install']['error_db_select']; if (!$error_msg) $step_complite = 1; } else { $_POST = array("db_host"=>"localhost","db_login"=>"","db_passwd"=>"","db_name"=>""); } if ($step_complite) { $_SESSION['step'] = 1; umask(0777); /** set chmod to folders */ chmod(SSP_DIR.'/data', 0777); chmod(SSP_DIR.'/img', 0777); chmod(SSP_DIR.'/img/buttons', 0777); Quote Link to comment https://forums.phpfreaks.com/topic/191849-php-script-works-on-some-servers-and-not-others/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 12, 2010 Share Posted February 12, 2010 The code most likely is using short open tags <? and <?=, which was another blunder by php. Who would make multiple different tags the define what php code IS, then make some of them optional/conditional with the ability to turn them off. Php.net itself points out - "It's been recommended for several years that you not use the short tag "short cut" and instead to use the full <?php and ?> tag combination." and that short open tags not be used in code that is intended to be distributed (i.e. sold or posted for others to use) because it results in code that is not portable between different server configurations. I would recommend that you take a few minutes with a programing editor and do a search/replace on all the <? and <?= and convert them to <?php and <?php echo so that the code will work on all server configurations. Quote Link to comment https://forums.phpfreaks.com/topic/191849-php-script-works-on-some-servers-and-not-others/#findComment-1011356 Share on other sites More sharing options...
blueboat51 Posted February 13, 2010 Author Share Posted February 13, 2010 Thanks PFMaBiSmAd , You are right on the money, Thank you so much for your help. I set short_open _tags to On from Off in php.conf entertaining the short tags. and it works great , I'll edit the tags as you suggested, Once again thank you! Quote Link to comment https://forums.phpfreaks.com/topic/191849-php-script-works-on-some-servers-and-not-others/#findComment-1011771 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.