Author Topic: [Warning: stat failed ...] Problem with <tmpl_include ...  (Read 1089 times)

0 Members and 1 Guest are viewing this topic.

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
[Warning: stat failed ...] Problem with <tmpl_include ...
on: Mon, 26. August 2002 - 16:26:20
Some of my PHD users have problem with the <tmpl_include ...

Error/warning:
"Warning: stat failed for ./print_pic.htm (errno=2 - No such file or directory) in /usr/local/httpd/htdocs/crm/include/vLib/vlibTemplate.php on line 887"

Problem: <tmpl_include file='print_pic.htm'>

Solution:
Change ERROR_REPORTING in your php.ini from
E_ALL ~ E_NOTICE
to
E_ALL & ~E_NOTICE & ~E_WARNING

But why does this problem only occurs on some servers?
- 5 without problems
- 2 with this error/warning

In my line 887 (vlibTemplate.php):

885 --> // check fullpath first..
886 --> $fullpath = $filepath.'/'.$filename;
887 --> if (is_file($fullpath)) return $fullpath;

Any idea?

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
[Warning: stat failed ...] Problem with <tmpl_include ...
Reply #1 on: Tue, 27. August 2002 - 13:49:12
I found out, that this problems occurs on (all?) SuSe Linux 8.0 LAMP standard installations.

Your include example (vlibTemplate_include.php) isn't working either.

Error/Warning:
"Warning: stat failed for ./vlibTemplate_include2.html (errno=2 - No such file or directory) in /usr/local/httpd/htdocs/NSM/vlibTemplate.php on line 887"

I have searched the web for this error, but found nothing that is helpful.

Do you have any idea, Kelvin?

Best regards,
Claus

PS: It looks right though ...
Quote
Warning: stat failed for ./vlibTemplate_include2.html (errno=2 - No such file or directory) in /usr/local/httpd/htdocs/NSM/vlibTemplate.php on line 887
This is the header in the main template files.. 
blah blah blah... 

I am the footer of the page, this is from vTemplate_include2.html included using <tmpl_include>. show source

releasedj

  • Guest
[Warning: stat failed ...] Problem with <tmpl_include ...
Reply #2 on: Tue, 27. August 2002 - 17:17:06
Apparently this was a bug in PHP 4.1.2 on Linux. This should be fixed in versions released since 4.1.2, and id thus NOT a bug in vlibTemplate.
If you cannot update PHP then you can modify vlibTemplate around about line 890 there's a line that looks like this:
Code: [Select]
if is_file$fullpath return $fullpath;

.. you should change this to:
Code: [Select]
if @is_file$fullpath return $fullpath;
.. which will surpress errors from this function.

Here's the bug link on php.net:
   http://bugs.php.net/bug.php?id=15932

I hope this helps as well.

Kelvin

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
[Warning: stat failed ...] Problem with <tmpl_include ...
Reply #3 on: Tue, 27. August 2002 - 21:59:31
It is bug

http://bugs.php.net/bug.php?id=14424

I am quite sure this warning is only generated on PHP 4.1.0.

How many different PHP versions do you have vlibTemplate running on?

I have 4.1.1 (Windows) and 4.1.2 (Linux). No problems there.

I will ask my users to upgrade their PHP version.

Thanks for your help.
Claus

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
[Warning: stat failed ...] Problem with <tmpl_include ...
Reply #4 on: Tue, 27. August 2002 - 22:18:21
I do not think it is Bug #15932.

It says:

---
If $dir doesn't exist, the following warning is generated:

Warning: stat failed for dir/filename.exe (errno=20 - Not a directory)
in script.php on line n.
---

But the dir and the file are there and it is not "errno=20" it is "errno=2".

I think this bug will only occur on 4.1.0, nowhere else.

Please tell me if I'm wrong and you got it under 4.1.2++, too.

Best regards,
Claus

releasedj

  • Guest
[Warning: stat failed ...] Problem with <tmpl_include ...
Reply #5 on: Wed, 28. August 2002 - 10:07:23
activefish.com runs PHP 4.2.2 on FreeBSD and it works fine.
At home I run PHP 4.0.6 (I think) on Windows 2000 and it works there too.

Thanks for your input Claus!

Kelvin

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
[Warning: stat failed ...] Problem with <tmpl_include ...
Reply #6 on: Wed, 28. August 2002 - 15:21:08
I think both ways (upgrading) or supress the error are ok.