cancel
Showing results for 
Search instead for 
Did you mean: 

ccgi down

Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: ccgi down

Quote from: Tony
Almost there now, just on last section trying to find out why a section of my PHP code no longer puts partial output on to the browser screen.

Try sticking "implicit_flush = 1" into your php.ini
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,899
Thanks: 5,008
Fixes: 316
Registered: ‎04-04-2007

Re: ccgi down

Quote from: Gabe
Quote from: Bob
We're looking at a problem with POST variables Tony

Try turning register_globals = Off using the php.ini file I sent you.
Edit: sorry, that's addressed to Tony. I also posted one somewhere round here.

Yep, over here  Smiley

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

Tony_W
Grafter
Posts: 745
Registered: ‎11-08-2007

Re: ccgi down

Quote from: Gabe
But Ben's is the more correct solution. You were using $PHP_SELF rather than $_SERVER['PHP_SELF'] and turning register_globals off kills $PHP_SELF, leaving your form with action="". That's an old trick to get a form to post to itself but not good html, so the substitution is better.

Tried using::
<form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">
and renaming php.ini to deactivate it and it did not work.
Quote
Try sticking "implicit_flush = 1" into your php.ini

Rather than have everything in the php.ini file, can I just have the lines for the settings that I want to change? e.g. implicit_flush = 1
Tony
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: ccgi down

Quote from: Tony

<form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">

There seems to be some confusion. Unfortunately PHP_SELF won't work with POST forms at the moment, you can use $_SERVER['SCRIPT_URL'] instead. We may be able to fix PHP_SELF however it may be a limitation of suEXEC, which we're using on the new platform.
It's better to have register_globals set to off, for a variety of reasons, however we decided to initially run with it on, to ease the transition to the new platform.
Quote

Rather than have everything in the php.ini file, can I just have the lines for the settings that I want to change? e.g. implicit_flush = 1

Yes, although I've just tested that setting myself and it doesn't seem to help. I've been having a quick look at it (I'm not officially assigned to this just helping out a little in quiet moments here and there) and I fear it may be another side effect of using suexec, as it seems to work fine when I run it on the command line.
Tony_W
Grafter
Posts: 745
Registered: ‎11-08-2007

Re: ccgi down

Again, using:
<form name="form1" method="post" action="<?=$_SERVER['SCRIPT_URL']?>">
did work, but not if I took out the php.ini with the register_globals = off in it.
@Ben - yes there was no difference (no flushing) using the implicit_flush = 1 (or implicit_flush = on)
Tony
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: ccgi down

Quote from: Tony
Tried using::
<form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">
and renaming php.ini to deactivate it and it did not work.

Sorry, should have made it clear what I meant by the substitution.
Quote
Rather than have everything in the php.ini file, can I just have the lines for the settings that I want to change? e.g. implicit_flush = 1

Yes, but it overrides the whole php.ini, so a one line php.ini reduces everything else to defaults, which may cause problems.
Gabe
pcr
Dabbler
Posts: 10
Registered: ‎16-03-2010

Re: ccgi down

After additional messing around with .htaccess file, now a simple 3-line php script which calls phpinfo() function returns a slightly different message
Either the server is overloaded or there was an error in a CGI script.

Suggestions? We have already lost two days on this alone.
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: ccgi down

Quote from: Tony
Can someone please confirm that the PHP server buffering arrangements are different in the new server?

Any joy if you add
SetEnv no-gzip dont-vary

to your .htaccess?
Gabe
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: ccgi down

Quote from: pcr
After additional messing around with .htaccess file, now a simple 3-line php script which calls phpinfo() function returns a slightly different message

Will it run if you disable the .htaccess (add a letter before the dot)?
Gabe
maccladd
Newbie
Posts: 5
Registered: ‎15-03-2010

Re: ccgi down

Quote from: Gabe
Quote from: pcr
After additional messing around with .htaccess file, now a simple 3-line php script which calls phpinfo() function returns a slightly different message

Will it run if you disable the .htaccess (add a letter before the dot)?
Gabe

I get the same error and I don't have a .htaccess file (as far as I can see!)
Tony_W
Grafter
Posts: 745
Registered: ‎11-08-2007

Re: ccgi down

@Gabe - no joy I'm afraid, it just gave a blank page and said 'done' in the status bar of the browser.
Without the extra entry in .htaccess, it currently says 'Waiting for http://www.domainname.co.uk/php/filename.php'; and may time out, or it may eventually show the results.
Just so you can see what I'm up against, I'd better give you the code I'm using in that section:
$currentfilesize=filesize($myfile1);
$divider=0;
do {
  clearstatcache();
  flush();
  sleep(10);
  $divider++; 
  if ($divider % 6 == 0) {echo (">");}
} while (filesize($myfile1) == $currentfilesize);
?>
<script language="javascript" type="text/javascript">
window.location.replace( "<?php print $PHP_SELF ?>" );
</script>
</body>
</html>

As a brief explanation, the code before this section displays the contents of a file.
This section keeps checking (every 10 seconds) whether the file has changed size and keeps the browser 'alive' with a bit of output ('>') once a minute.
If the file has changed, it reloads the page using a Javascript reload which displays the new contents of the changed file. Bit of a hash-up, but it worked OK before the change.
Tony
Astronut
Grafter
Posts: 28
Thanks: 3
Fixes: 1
Registered: ‎31-01-2010

Re: ccgi down

Hi guys,
I've managed to avoid most of the usual problems as the CMS system I use (MODx) is written for PHP5, although I had a few permissions related headaches and have had to edit out one line of my .htaccess (namely "Options +FollowSymlinks") to avoid the 500 error.
I do have one ongoing problem though: logging into my CMS manager is very frustrating.  It often takes several attempts before the system accepts the login and I often get thrown out at no notice.  This is a known problem according to their help files, usually due to sessions being closed by "aggressive garbage collection".  Unfortunately, their proposed solution, adding the lines below (adjusting for the folder path) triggers more 500 errors.
   php_value session.save_path /path/to/your/web/content/sessions/  
  php_value session.gc_maxlifetime 28800 

If I am on the right track, what would be the correct path?  It's entirely possible I put the wrong one in!
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: ccgi down

Quote from: Tony


window.location.replace( "<?php print $PHP_SELF ?>" );


We're currently having problems with $PHP_SELF, does it work if you use $_SERVER['SCRIPT_URL'] instead?
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: ccgi down

Quote from: Astronut
If I am on the right track, what would be the correct path?  It's entirely possible I put the wrong one in!

Right track, but you'd need to make the changes in a custom php.ini (like <a href="http://community.plus.net/forum/index.php/topic,83568.msg696223.html#msg696223">this one</a>. The path will be something like /share/storage/0X/us/username/sessions/. You can get your path from phpinfo().
Gabe
Tony_W
Grafter
Posts: 745
Registered: ‎11-08-2007

Re: ccgi down

@Ben - thank you for your help but the original one ($PHP_SELF) worked OK, however the output (using echo) that should appear in the browser before reaching that point is not shown.
The window.location.replace( "<?php print $PHP_SELF ?>" ); line merely re-starts the PHP file.
It only gets to that line if the file contents has changed. The code shown is actually at the end of a real-time visit tracker.
It is not desperate as I have substituted a javascript 'refresh page every 2 minutes' to the html. I'm sure that other customers have more pressing needs, with whole sites falling over.
Thanks again,
Tony