paasikivenpieru Posted March 1, 2011 Share Posted March 1, 2011 I have spent almost 2 days looking for solution to the strangest error I have ever meet. Whenever I do commenting and my php script, the sricpt falls running. <?php error_reporting(E_ALL | E_STRICT); echo 'test1'; //echo 'testi2'; echo 'test3'; flush(); ?> trigger_error("Here we are!", E_USER_ERROR); This will output: test1. I have tried lot of things to find out the problem but I can't get any error message and whenever I remove the comments, the script works absolute fine. The script works also with comments in my local server, but whenever I download it on the other server, the problem appears. The file encoding is a UTF-8 format without BOM, and the file is one part of my Yii application. I haven't relasized similar behaving in other scripts. I wonder if someone has some idea what could cause this kind of behaving? I'm very thankful to man who can give me ideas... Quote Link to comment https://forums.phpfreaks.com/topic/229302-strangest-error-evercommenting-falls-the-php-script/ Share on other sites More sharing options...
Muddy_Funster Posted March 2, 2011 Share Posted March 2, 2011 does it do it with block comments as well or just the in line comment? Quote Link to comment https://forums.phpfreaks.com/topic/229302-strangest-error-evercommenting-falls-the-php-script/#findComment-1181640 Share on other sites More sharing options...
paasikivenpieru Posted March 2, 2011 Author Share Posted March 2, 2011 Hey, that was good point, I tried first time and the script didn't fall by block comments. So, just line comments kills the script. Quote Link to comment https://forums.phpfreaks.com/topic/229302-strangest-error-evercommenting-falls-the-php-script/#findComment-1181801 Share on other sites More sharing options...
PFMaBiSmAd Posted March 2, 2011 Share Posted March 2, 2011 Are you actually browsing to your file using a URL - http://localhost/your_file.php OR are you directly browsing to it using a file path - C:\some_path_on_your_computer\your_file.php? The symptom is that of a .php file being directly browsed to instead of being invoked through a web server. For the case where it does not work, what does a 'view source' in your browser show? Quote Link to comment https://forums.phpfreaks.com/topic/229302-strangest-error-evercommenting-falls-the-php-script/#findComment-1181804 Share on other sites More sharing options...
paasikivenpieru Posted March 2, 2011 Author Share Posted March 2, 2011 Im using it the server via http: actually it is there, but it could be possible that im making changes there now: http://portfolio.vallankumous.com/portfolio/index.php?r=site/viewWork&id=2 and source code looks like this, everything in generated between <?php ?> will not be showen after commentline, but all pure html code are included in source code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="language" content="en" /> <!-- blueprint CSS framework --> <link rel="stylesheet" type="text/css" href="/portfolio/css/screen.css" media="screen, projection" /> <link rel="stylesheet" type="text/css" href="/portfolio/css/print.css" media="print" /> <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="/portfolio/css/ie.css" media="screen, projection" /> <![endif]--> <link rel="stylesheet" type="text/css" href="/portfolio/css/main.css" /> <link rel="stylesheet" type="text/css" href="/portfolio/css/form.css" /> <script type="text/javascript" src="/portfolio/assets/bfd4392e/jquery.js"></script> <title>Vallankumous-portfoliot</title> </head> <body> <!-- <div class="container" id="page"--> <img src="/portfolio/images/V_logo.jpg" id="logo" /> <div id="header"> <form action="" method="GET"> <input id="searchWord" type="text" value="Löydä" style="font-size: 22px;font-weight: bolder;" size="29" name="searchWord" /> </form> <script language="javascript"> $('#searchWord').click(function() { $('#searchWord').val(""); }); </script> <br /> Hae tekijän nimen, työn lajin(esim. esite), työntekijän tai toimialan perusteella. </div><!-- header --> <div id="mainmenu"> string(61) "A session had already been started - ignoring session_start()" <ul id="yw0"> <li><a href="/portfolio/index.php?r=site/index">Home</a></li> <li><a href="/portfolio/index.php?r=site/login">Login</a></li> </ul> </div><!-- mainmenu --> <!-- breadcrumbs --> <div class="container"> <div id="content"> testi1testi2<br><br><br><br><table style="width: 1050px;"><tr><td width="245" style="vertical-align: top;"></td></tr></table> </div><!-- content --> </div> <!--div id="footer"> Vallankumos | Tehtaankatu Copyright © string(409) "date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Helsinki' for 'EET/2.0/no DST' instead" 2011 by My Company.<br/> All Rights Reserved.<br/> </div--> <!-- footer --> <!-- </div> page --> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/229302-strangest-error-evercommenting-falls-the-php-script/#findComment-1181838 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.