I am trying to echo the logfiles on my server onto a page but I get the following error messages:
The code I am using is:
Code:
Connected as [email protected]
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 17
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051013.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 17
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 18
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051014.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 18
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 19
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051015.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 19
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 20
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051016.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 20
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 21
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051017.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 21
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 22
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051018.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 22
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 23
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051019.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 23
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 24
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051020.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 24
Warning: fopen(): php_hostconnect: connect failed in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 25
Warning: fopen(ftp://yarrt.com/logfiles/W3SVC1164009808/ex051021.log): failed to open stream: Bad file descriptor in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 25
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 27
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 28
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 29
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 30
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 31
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 32
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 33
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 34
Warning: fread(): supplied argument is not a valid stream resource in e:\domains\y\yarrt.com\user\htdocs\statstest\index.php on line 35
The code I am using is:
PHP:
<?php
$ftp_server = "ftp.yarrt.com";
$ftp_user = "---------------";
$ftp_pass = "---------------";
// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
echo "Connected as $ftp_user@$ftp_server\n";
} else {
echo "Couldn't connect as $ftp_user\n";
}
$file1=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051013.log','r');
$file2=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051014.log','r');
$file3=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051015.log','r');
$file4=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051016.log','r');
$file5=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051017.log','r');
$file6=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051018.log','r');
$file7=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051019.log','r');
$file8=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051020.log','r');
$file9=fopen('ftp://yarrt.com/logfiles/W3SVC1164009808/ex051021.log','r');
echo fread($file1,filesize($file1)).'<br><br>';
echo fread($file2,filesize($file2)).'<br><br>';
echo fread($file3,filesize($file3)).'<br><br>';
echo fread($file4,filesize($file4)).'<br><br>';
echo fread($file5,filesize($file5)).'<br><br>';
echo fread($file6,filesize($file6)).'<br><br>';
echo fread($file7,filesize($file7)).'<br><br>';
echo fread($file8,filesize($file8)).'<br><br>';
echo fread($file9,filesize($file9));
// close the connection
ftp_close($conn_id);
?>






