# PHP Filesize

**URL:** https://forum.kirupa.com/t/php-filesize/157423
**Category:** programming
**Created:** [August 1, 2005, 9:46pm UTC](https://forum.kirupa.com/t/php-filesize/157423 "2005-08-01T21:46:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Phlashman](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@Phlashman](https://forum.kirupa.com/u/Phlashman)
#### Post date: [August 1, 2005, 9:46pm UTC](https://forum.kirupa.com/t/php-filesize/157423/1 "2005-08-01T21:46:35Z")

</div>

My filesize isn’t working :O. I don’t even know what I did wrong. Here’s my script:

```php
<?php
$size = filesize("http://www.sherman.stonerocket.net/zd/matches.xml");
echo $size;
?>

```

It returns this error:

> **Warning** : filesize(): Stat failed for [http://www.sherman.stonerocket.net/zd/robots.txt](http://www.sherman.stonerocket.net/zd/robots.txt) (errno=2 - No such file or directory) in **/home/sherman/public\_html/zd/u1.php** on line **2**

Any clue what I’m doing wrong? I’ve tried a bunch of files, and they’ve all failed…

Also, I’ve noticed that if I just write the relative directory, it does work. However, I need to run an absolute directory, as the xml file is a higher level than the PHP file. What’s wrong?
