Smarty gives File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am sure that I am making a simple boneheaded mistake and I would
appreciate your help in spotting in.  I have just installed
on a system running WindowsXP SP2.

Apache and PHP tested out fine.  After adding Smarty, I ran the
following http://localhost/testphp.php

where testphp.php is in C:\Program Files\Apache Group\Apache2\htdocs
and contains:

$smarty = new Smarty;

I keep seeing this in the apache error log:

[Tue Feb 22 01:36:28 2005] [notice] Apache/2.0.53 (Win32) configured --
resuming normal operations
[Tue Feb 22 01:36:28 2005] [notice] Server built: Feb 10 2005 06:11:34
[Tue Feb 22 01:36:28 2005] [notice] Parent: Created child process 2528
[Tue Feb 22 01:36:28 2005] [notice] Disabled use of AcceptEx() WinSock2
[Tue Feb 22 01:36:28 2005] [notice] Child 2528: Child process is
[Tue Feb 22 01:36:28 2005] [notice] Child 2528: Acquired the start
[Tue Feb 22 01:36:28 2005] [notice] Child 2528: Starting 250 worker
[Tue Feb 22 01:36:28 2005] [notice] Child 2528: Listening on port 80.
[Tue Feb 22 01:36:56 2005] [error] [client] File does not
exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

Why is Apache looking in C:/Program Files/Apache Group/Apache2/htdocs/

favicon.ico is in path C:\Program Files\Apache

My directory structure looks like this:


C:\Program Files\Apache Group\Apache2>

conf.httpd looks like this with comments and some stuff at the end
removed to save space in this post.

# Do NOT add a slash at the end of the directory path.
ServerRoot "C:/Program Files/Apache Group/Apache2"

PidFile logs/

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild  0

Listen 80

LoadModule access_module modules/
LoadModule actions_module modules/
LoadModule alias_module modules/
LoadModule asis_module modules/
LoadModule auth_module modules/
#LoadModule auth_anon_module modules/
#LoadModule auth_dbm_module modules/
#LoadModule auth_digest_module modules/
LoadModule autoindex_module modules/
#LoadModule cern_meta_module modules/
LoadModule cgi_module modules/
#LoadModule dav_module modules/
#LoadModule dav_fs_module modules/
LoadModule dir_module modules/
LoadModule env_module modules/
#LoadModule expires_module modules/
#LoadModule file_cache_module modules/
#LoadModule headers_module modules/
LoadModule imap_module modules/
LoadModule include_module modules/
#LoadModule info_module modules/
LoadModule isapi_module modules/
LoadModule log_config_module modules/
LoadModule mime_module modules/
#LoadModule mime_magic_module modules/
#LoadModule proxy_module modules/
#LoadModule proxy_connect_module modules/
#LoadModule proxy_http_module modules/
#LoadModule proxy_ftp_module modules/
LoadModule negotiation_module modules/
#LoadModule rewrite_module modules/
LoadModule setenvif_module modules/
#LoadModule speling_module modules/
#LoadModule status_module modules/
#LoadModule unique_id_module modules/
LoadModule userdir_module modules/
#LoadModule usertrack_module modules/
#LoadModule vhost_alias_module modules/
#LoadModule ssl_module modules/

# PHP 5 installation:
LoadModule php5_module "c:/php5/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php5"

ServerAdmin xxxxx@xxxxxxx


UseCanonicalName Off

DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride None

<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
    Options Indexes IncludesNOEXEC ExecCGI mULTIvIEWS FollowSymLinks
    Order allow,deny
    Allow from all


UserDir "My Documents/My Website"

DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all

TypesConfig conf/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic

HostnameLookups Off

ErrorLog logs/error.log

LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%i\"
\"%i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%i -> %U" referer
LogFormat "%i" agent

CustomLog logs/access.log common

ServerTokens Full

ServerSignature Off

Alias /icons/ "C:/Program Files/Apache Group/Apache2/icons/"

<Directory "C:/Program Files/Apache Group/Apache2/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all

AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "C:/Program
Files/Apache Group/Apache2/manual$1"

<Directory "C:/Program Files/Apache Group/Apache2/manual">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all

    <Files *.html>
        SetHandler type-map

    SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/
    RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru))(/.*)?$

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"

<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

IndexOptions FancyIndexing VersionSort

[sniped a bunch of hopefully not relevant stuff]


php.ini looks like this with comments and some stuff sniped to save
space in this post:


engine = On

; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode = Off

short_open_tag = On

; Allow ASP-style <% %> tags.
asp_tags = Off

; The number of significant digits displayed in floating point numbers.
precision    =  14

; Enforce year 2000 compliance (will cause problems with non-compliant
y2k_compliance = On

output_buffering = 4096

zlib.output_compression = Off

implicit_flush = Off


serialize_precision = 100

allow_call_time_pass_reference = Off

safe_mode = Off

safe_mode_gid = Off

safe_mode_include_dir =

safe_mode_exec_dir =

safe_mode_allowed_env_vars = PHP_

safe_mode_protected_env_vars = LD_LIBRARY_PATH
directive is

disable_functions =

disable_classes =

; Colors for Syntax Highlighting mode.  Anything that's acceptable in
; <font color="??????"> would work.
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000

; Misc
; Decides whether PHP may expose the fact that it is installed on the
; (e.g. by adding its signature to the Web server header).  It is no
; threat in any way, but it makes it possible to determine whether you
use PHP
; on your server or not.
expose_php = Off

; Resource Limits ;

max_execution_time = 30     ; Maximum execution time of each script, in
max_input_time = 60    ; Maximum amount of time each script may spend
parsing request data
memory_limit = 8M      ; Maximum amount of memory a script may consume

; Error handling and logging ;

; error_reporting is a bit-field.  Or each number up to get desired
; reporting level
; E_ALL             - All errors and warnings (doesn't include
; E_ERROR           - fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often
;                     from a bug in your code, but it's possible that
it was
;                     intentional (e.g., using an uninitialized
variable and
;                     relying on the fact it's automatically
initialized to an
;                     empty string)
; E_STRICT          - run-time notices, enable to have PHP suggest
;                     to your code which will ensure the best
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
; Examples:
;   - Show all errors, except for notices and coding standards warnings
;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
;   - Show all errors, except for notices
;error_reporting = E_ALL & ~E_NOTICE
;   - Show only errors
;   - Show all errors
error_reporting  =  E_ALL

; Print out errors (as a part of the output).  For production web
; you're strongly encouraged to turn this feature off, and use error
; instead (see below).  Keeping display_errors enabled on a production
web site
; may reveal security information to end users, such as file paths on
your Web
; server, your database schema or other information.
display_errors = Off

; Even when display_errors is on, errors that occur during PHP's
; sequence are not displayed.  It's strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = Off

; Log errors into a log file (server-specific log, stderr, or error_log
; As stated above, you're strongly advised to use error logging in
place of
; error displaying on production web sites.
log_errors = On

; Set maximum length of log_errors. In error_log information about the
source is
; added. The default is 1024 and 0 allows to not apply any maximum
length at all.
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file
on same
; line until ignore_repeated_source is set true.
ignore_repeated_errors = Off

; Ignore source of message when ignoring repeated messages. When this
; is On you will not log errors with repeated messages from different
files or
; sourcelines.
ignore_repeated_source = Off

; If this parameter is set to Off, then memory leaks will not be shown
; stdout or in the log). This has only effect in a debug compile, and
; error reporting includes E_WARNING in the allowed list
report_memleaks = On

; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off


; Magic quotes

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from
exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =


; Paths and Directories ;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
; Windows: "\path1;\path2"
;include_path = ".;c:\php5\includes\"
include_path = ".;c:\php5\includes"

doc_root = "C:\Program Files\Apache Group\Apache2\"

; The directory under which PHP opens the script using /~username used
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"

; Whether or not to enable the dl() function.  The dl() function does
NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is
; disabled on them.
enable_dl = On

--Thank you,
--Mike Jr.

Re: Smarty gives File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

A favicon can appear in any folder on your site and is normally in the
route.  When browsers request your site they often will look for a
favicon in the same page as the requested file -- end of.  A favicon
outside of the webroot as nothing to do with your error log.

Re: Smarty gives File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico

James wrote:
Quoted text here. Click to load it

 Thank you.  Downloading and installing Apache, PHP, Smarty, and MySQL
was my project for the weekend; That and being a father to my three
boys.  Since I downloaded a vanilla installation and ran the simplest
of scripts, I was surprised that a favorite icon was requested at all.
I got around the problem by copying favicon.ico from path C:\Program
Files\Apache Group\Apache2\manual\images to where Smarty was looking
for it and the problem went away.  I am still curious why the icon was
being requested at all.

Well, learning something new is why I started all this.  There are some
other wrinkles that I am investigating,

[client] PHP Parse error:  syntax error, unexpected T_STRING
in C:\Program Files\Apache Group\Apache2\htdocs\index.php on line

But it's all fun.

--Best regards,
--Mike Jr.

Site Timeline