View previous topic :: View next topic |
Author |
Message |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Thu Jul 07, 2005 8:45 pm Post subject: Script Execution Speed |
|
|
Is there any way to speed up the execution of PHP scripts on my computer?All the scripts I host on my computer run slowly, yet the ones on other site run very swiftly. |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Thu Jul 07, 2005 8:46 pm Post subject: |
|
|
Get a better computer ;) The faster the cpu, the faster the script. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Thu Jul 07, 2005 8:51 pm Post subject: |
|
|
You can also try to tidy up the code of the script, assuming you have a basic understanding of it. _________________
 |
|
Back to top |
 |
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Thu Jul 07, 2005 9:22 pm Post subject: |
|
|
I have a VERY FAST cpu. |
|
Back to top |
|
 |
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Thu Jul 07, 2005 10:25 pm Post subject: |
|
|
Do a search for gzip on this forum. |
|
Back to top |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Fri Jul 08, 2005 9:09 am Post subject: |
|
|
p3 wrote: | I have a VERY FAST cpu. |
1.5ghz is not VERY FAST anymore. Welcome to 2005. |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Jul 08, 2005 9:12 am Post subject: |
|
|
The AbyssUnderground.co.uk forums has a Gzip Compression method.
Sincerely , TRUSTpunk |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Fri Jul 08, 2005 10:06 am Post subject: |
|
|
Your computer must be laced with spyware then as my server is 1.3GHz Duron and it performs perfectly well, even TRUSTpunk only has 366Mhz of processing power and even the most extreame scripts are easy for it.
Try formatting your PC and/or getting a decent pc to begin with. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Fri Jul 08, 2005 3:27 pm Post subject: |
|
|
The Inquisitor wrote: | Try formatting your PC and/or getting a decent pc to begin with. |
Sounds fun.
Try gzipping your scripts and make sure you have no heavily cpu demanding programs running. _________________
 |
|
Back to top |
 |
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Fri Jul 08, 2005 4:00 pm Post subject: |
|
|
How about a link???
Sounds like a good idea, but I just get a bunch of different programs called gzip if I Google it!!!! |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Fri Jul 08, 2005 4:13 pm Post subject: |
|
|
PhpBB Gzip Header:
Code: | $phpver = phpversion();
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
{
if ( extension_loaded('zlib') )
{
ob_start('ob_gzhandler');
}
}
else if ( $phpver > '4.0' )
{
if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
} |
PhpBB Gzip Footer:
Code: | if ( $do_gzip_compress )
{
//
// Borrowed from php.net!
//
$gzip_contents = ob_get_contents();
ob_end_clean();
$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack('V', $gzip_crc);
echo pack('V', $gzip_size);
}
exit; |
At least I think that examples from phpbb. On php5 its as simple as inserting 1 line, but I dont know what version you have, so use that. _________________
 |
|
Back to top |
 |
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Fri Jul 08, 2005 5:04 pm Post subject: |
|
|
MonkeyNation wrote: | PhpBB Gzip Header:
Code: | $phpver = phpversion();
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
{
if ( extension_loaded('zlib') )
{
ob_start('ob_gzhandler');
}
}
else if ( $phpver > '4.0' )
{
if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
} |
PhpBB Gzip Footer:
Code: | if ( $do_gzip_compress )
{
//
// Borrowed from php.net!
//
$gzip_contents = ob_get_contents();
ob_end_clean();
$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack('V', $gzip_crc);
echo pack('V', $gzip_size);
}
exit; |
At least I think that examples from phpbb. On php5 its as simple as inserting 1 line, but I dont know what version you have, so use that. |
I use php 5 |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Jul 08, 2005 7:50 pm Post subject: |
|
|
p3 wrote: | How about a link???
Sounds like a good idea, but I just get a bunch of different programs called gzip if I Google it!!!! |
If you would have read my reply , I told you where to go in order to find the
Gzip method , all you had to do was search the AbyssUnderground.co.uk. :/
http://www.abyssunderground.co.uk/forum/viewtopic.php?t=17
Sincerely , TRUSTpunk |
|
Back to top |
|
 |
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
|
Back to top |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Fri Jul 08, 2005 9:31 pm Post subject: |
|
|
That didn't help at all :( |
|
Back to top |
|
 |
|