Page 1 of 1

images do not work properly

PostPosted: 11. September 2007 15:09
by jurisz
I have my own counter (for statistics) and it works great for some time and after some time image not work (this counter script use many sites and it make big server load). When I restart apache (stop server and apache_stop.bat) because when I click on stop apache only in control panel I can not start apache again. PHP script works with files (I do not use mysql in this script). This script on other server (Linux hosting) works perfectly.

PostPosted: 12. September 2007 07:03
by jurisz
please help me :(

PostPosted: 13. September 2007 03:13
by Izzy
This may not be an XAMPP server issue.

The link that gets the image and puts it in your web page may not always be available or may take some time to load in your page.

To test this when you don't see an image is to copy the image link from your script and paste it directly into the address bar of your browser
For example:
http://counter.com/counterimage.jpg
Check your script for the correct counter image address.

If the counter image server is working then you will see the counterimage.jpg.

If the counter image server is congested or down then you will not see the image and your browser may time out the connection waiting for it to load.

This is not an uncommon issue when having third party content loaded dynamically into your pages. The delays or no display at all can be caused by the counter device's server being overloaded or down for maintenance etc.
When I restart apache (stop server and apache_stop.bat) because when I click on stop apache only in control panel I can not start apache again.

This needs to be checked out why this is happening.

Before starting the XAMPP Control Panel make sure that apache and mysql etc. are stopped.
Use the Windows Task Manager (right click on the Task Bar and select it) to check that no apache or any other XAMPP component Processes are running.
Kill any that might be running.

Then start the XAMPP Control Panel and use it exclusively or use the bat files instead of the XCP exclusively. See if that helps.


=================================================
Take a look at the new DeskTopXampp launch control for XAMPP and XAMPPlite (DTX.exe)
http://nat32.com/dtx/
posted by ridgewood:
http://community.apachefriends.org/f/viewtopi ... 967#103967
Also available here: http://zedfiles.com/DTX/
I highly recommend DTX.
=================================================

Re: Ha

PostPosted: 14. September 2007 22:01
by jurisz
I have theese errors: Warning: imagestring(): supplied argument is not a valid Image resource in E:\xampp\htdocs\engtop\count1.php on line 64

Warning: imagestring(): supplied argument is not a valid Image resource in E:\xampp\htdocs\engtop\count1.php on line 73

Warning: imagestring(): supplied argument is not a valid Image resource in E:\xampp\htdocs\engtop\count1.php on line 81

Warning: imagestring(): supplied argument is not a valid Image resource in E:\xampp\htdocs\engtop\count1.php on line 90

Warning: imagestring(): supplied argument is not a valid Image resource in E:\xampp\htdocs\engtop\count1.php on line 98

Warning: Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs\engtop\count1.php:64) in E:\xampp\htdocs\engtop\count1.php on line 100

Warning: imagegif(): supplied argument is not a valid Image resource in E:\xampp\htdocs\engtop\count1.php on line 101

Warning: imagedestroy(): supplied argument is not a valid Image resource in E:\xampp\htdocs\engtop\count1.php on line 102

coun1.php:

Code: Select all
<?
Error_Reporting(E_ALL & ~E_NOTICE);
include 'dan.php';

if($did==""){$did=1;}
include"test3.php";

if(@file("$site/$did.dat")){
$ar_online=@file("$online/$did.dat");

$brauz=getenv('HTTP_USER_AGENT');
$brauz=trim(htmlspecialchars(stripslashes($brauz)));
$agent="$REMOTE_ADDR";

foreach ($ar_online  as $key => $value)
{$value=trim($value);
$uz_online=explode("|<br/>|",$value);
$time_end=$time-$timeof;

if($brauz!=$uz_online[1] || $agent!=$uz_online[2]){ if($uz_online[0]>$time_end ){
   $new_online[]="$value\r\n"; } }


if($brauz==$uz_online[1] & $agent==$uz_online[2]){$metod="old";}
}

$new_online[]="$time|<br/>|$brauz|<br/>|$agent\r\n";



$ar_rekod="";
foreach ($new_online  as $key => $value){
$ar_rekod="$ar_rekod$value";
$se_online++;
}
      $fp=@fopen("$online/$did.dat","w");
      @fputs($fp,$ar_rekod);
      @fclose($fp);
      @chmod ("$online/$did.dat", 0777);


$ar_shet=@file("$rek/$did.dat");
$ar_shet=explode("|<br/>|", $ar_shet[0]);

$den=date("d",$time);
if($den!=$ar_shet[3]){$ar_shet[4]=$ar_shet[1]; $ar_shet[0]=0; $ar_shet[1]=0; $ar_shet[3]=$den; }

$ar_shet[0]++;
if($metod!="old"){ $ar_shet[1]++; $ar_shet[2]++; }

      $fp=@fopen("$rek/$did.dat","w");
      @fputs($fp,"$ar_shet[0]|<br/>|$ar_shet[1]|<br/>|$ar_shet[2]|<br/>|$ar_shet[3]|<br/>|$ar_shet[4]");
      @fclose($fp);
      @chmod ("$rek/$did.dat", 0777);

$im = ImageCreateFromgif("count1.gif");

$m=$pix;
$k=$se_online;
while($k>=1){
$m=$m-5;
$k=$k/10;
}
 ImageString ($im, 1, $m, $otstup[0],$se_online,$color);


$m=$pix;
$k=$ar_shet[0];
while($k>=1){
$m=$m-5;
$k=$k/10;
}
 ImageString ($im, 1, $m, $otstup[1],$ar_shet[0],$color);

$m=$pix;
$k=$ar_shet[1];
while($k>=1){
$m=$m-5;
$k=$k/10;
}
 ImageString ($im, 1, $m, $otstup[2],$ar_shet[1],$color);


$m=$pix;
$k=$ar_shet[4];
while($k>=1){
$m=$m-5;
$k=$k/10;
}
 ImageString ($im, 1, $m, $otstup[3],$ar_shet[4],$color);

$m=$pix;
$k=$ar_shet[2];
while($k>=1){
$m=$m-5;
$k=$k/10;
}
 ImageString ($im, 1, $m, $otstup[4],$ar_shet[2],$color);

header("Content-type: image/gif");
  imagegif($im);
imagedestroy($im);}

else{
$image  = imagecreatetruecolor(110,30);
imagefill($image, 0, 0, 0xFF0000);
ImageString ($image, 5, 30, 7,"jghkgk",1);
header("Content-type: image/gif");
imagegif($image);
imagedestroy($im);}

?>



But when I restart apache image work again.

PostPosted: 15. September 2007 11:00
by Wiedmann
supplied argument is not a valid Image resource

Your Image resource is defined here:
Code: Select all
$im = ImageCreateFromgif("count1.gif");


You should use a "error_reporting(E_ALL);" to see all PHP problems and also look into the "error.log".

PostPosted: 15. September 2007 11:09
by jurisz
I am confused because it is simple gif image (Image created in Paint :oops: ). I will check error_log...

PostPosted: 18. September 2007 10:03
by jurisz
I have one error in error_log (other errors are in other scripts):

[Tue Sep 18 11:51:23 2007] [warn] (OS 64)The specified network name is no longer available. : winnt_accept: Asynchronous AcceptEx failed.

Image not work but in browser I can view this image (http://path/count2.gif)

Maybe it is because this script was on other server and I added on old server <?php header("location: new_server/new_path/count.php?did=1"); ?>

If I run script from http://new_server/new_path/count.php?did=1 I have the same problem :(

PostPosted: 18. September 2007 19:32
by jurisz
I have new problem: Undefined variable: se_online in E:\xampp\htdocs\engtop\count1.php on line 34

PostPosted: 21. September 2007 15:48
by jurisz
UP