Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: N3RVE on August 05, 2009, 10:08:59 AM

Title: What is file_check.php?
Post by: N3RVE on August 05, 2009, 10:08:59 AM
The file, "file_check.php" is a tool used to check SMF source files for common errors like files not beginning with the php opening tag (<?php) and not ending with closing tags (?>), it also checks for files saved as UTF-8 BOM (http://en.wikipedia.org/wiki/Byte-order_mark).

This tool can be used to diagnose forums with issues such as CAPCTHA verification images not showing, quote problems, etc. Simply upload the file to the Forum's root directory (the same directory as SSI.php), and navigate your browser to:

http://www.example.com/forum/file_check.php

-[n3rve]
Title: Re: What is file_check.php?
Post by: Bancherd on August 05, 2009, 06:04:15 PM
Hmm..I ran the file on my site and it told me that there were many xxx.php files such as index.php that did not end with (?>).  But when I opened the files in question using "gedit", I did not find anything unusual; (?>) was at the end of each of the files as it should.

???
Title: Re: What is file_check.php?
Post by: N3RVE on August 05, 2009, 06:24:58 PM
Can you attach one of the files so I can take a look?
Remember, the script is programmed to output an error if '<?php' and '?>' are not on the very first and last lines respectively, so it will definitely report ssi_examples.php seeing that the developers broke out of php mode and ended the file with </html> instead.

-[n3rve]
Title: Re: What is file_check.php?
Post by: Bancherd on August 06, 2009, 03:04:53 AM
Here is one of the files: /Sources/LoginOut.php  (SMF1.1.10)

Thanks for checking into this.  :D
Title: Re: What is file_check.php?
Post by: Yigal on August 06, 2009, 03:19:13 AM
Should this be stickied?
Title: Re: What is file_check.php?
Post by: N3RVE on August 06, 2009, 03:33:27 AM
Benchard, that file doesn't end with ?>, there's an extra blank line after the closing tag.
Remove the blank line and run the file_check script again :).

-[n3rve]
Title: Re: What is file_check.php?
Post by: Bancherd on August 06, 2009, 10:27:30 AM
Quote from: [n3rve] on August 06, 2009, 03:33:27 AM
Benchard, that file doesn't end with ?>, there's an extra blank line after the closing tag.
Remove the blank line and run the file_check script again :).

-[n3rve]

Ah..so..that was the problem! Thanks! :)
Title: Re: What is file_check.php?
Post by: fizanos on November 16, 2009, 10:13:51 AM
Hello I tried it for mine but the codes are not complete its 5 instead of 6. Pls Help
Title: Re: What is file_check.php?
Post by: Arantor on November 16, 2009, 10:45:47 AM
It has nothing to do with this, fizanos. Please keep the question to its own thread where it will be dealt with in due course.
Title: Re: What is file_check.php?
Post by: H on November 16, 2009, 04:53:29 PM
Locking this. If you have a problem please start a new topic so that we can track each problem individually.

Thanks