# Local host apache and php problem

**URL:** <https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754>\
**Category:** Uncategorized\
**Created:** [September 19, 2004, 4:51pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754 "2004-09-19T16:51:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)\
**Post date:** [September 19, 2004, 4:51pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/1 "2004-09-19T16:51:12Z")

</div>

I’ve just set up apache on my computer following the tutorial on kirupa -\> [http://www.kirupa.com/web/apache\_php.htm](http://www.kirupa.com/web/apache_php.htm)

It’s working great, but it seems extra sensetive to things. for example, if i’m reading text file, and i want to put it into a variable i’d do this:

```php
$page = fread($handle, filesize($file));

```

now, this works fine on my server, even when the file is empty, and i can echo it no problem and everything is hunky dorey 🙂

but when i try it from my computer, and the text file is empty, it comes up with a warning saying that it needs to read an amount of the file greater than 0. it still works howeber, the file is echoed just fine.

how can i stop this??  
thanks very much.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 19, 2004, 4:56pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/2 "2004-09-19T16:56:05Z")

</div>

in your php ini file, look for warning level, and lower it 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 19, 2004, 5:24pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/3 "2004-09-19T17:24:19Z")

</div>

Try

```php

$page = @fread($handle, filesize($file));

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 19, 2004, 5:29pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/4 "2004-09-19T17:29:40Z")

</div>

> [@bombingpixels](#):
>
> in your php ini file, look for warning level, and lower it 🙂

thanks. that’s great 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 19, 2004, 5:49pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/5 "2004-09-19T17:49:34Z")

</div>

but how is i do that? i can’t find it in the php.ini that’s in C:\Windows  
if i need to add it, what’s the variable name and what should i set it to?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 19, 2004, 6:32pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/6 "2004-09-19T18:32:42Z")

</div>

[http://us2.php.net/manual/en/ref.errorfunc.php#ini.display-errors](http://us2.php.net/manual/en/ref.errorfunc.php#ini.display-errors)

try using an ini set and setting this to a low value

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 19, 2004, 7:39pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/7 "2004-09-19T19:39:49Z")

</div>

ah. got it. thank you

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 21, 2004, 7:40am UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/8 "2004-09-21T07:40:01Z")

</div>

but it’s still an error!

try

```php

if (filesize ($file) > 0) {
   $page = fread($handle, filesize($file));
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 21, 2004, 3:49pm UTC](https://forum.kirupa.com/t/local-host-apache-and-php-problem/64754/9 "2004-09-21T15:49:56Z")

</div>

yeah i used that. what i was wanting was how to edit my warning level, and i got it, so thanks guys 🙂
