DeveloperSide.NET Forums
July 06, 2020, 06:42:34 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: No images display on localhost  (Read 13694 times)
0 Members and 1 Guest are viewing this topic.
Alec
Member
*
Posts: 12


View Profile
« on: January 06, 2006, 06:05:08 AM »

Hi all, first time poster here...

I can't get images to display on localhost pages.

If I provide an absolute path (G:/www/webroot/ifc/images/NoImage.jpg) everything's fine, but when I provide path relative to the document I get no love (ie ).

I gave a copy of the folders to a friend who installed an EasyPHP implementation (also using Apache but don't know which version) and the images work fine on his computer.

If I look at the broken image properties, the path is right (http://localhost/IFC/images/NoImage.jpg) but if I enter this url in the address bar, I get a 'page cannot be displayed' error.
I've tried jpg, gif and bmp with the same result. The capitalisation was correct.

If I link to the image and try to Save As, I get 'IE cannot download NoImage.jpg from localhost. The connection to the server was reset'.

I linked to other file types (doc, xls, pdf, zip). When I Save As, I get either 'connection to the server was reset' or 'server returned an invalid or unrecognized response' or 'requested site is either unavailable or cannot be found'. Which message I get seems to be random.

I'm using IE6 running on W2K Pro and Apache 2.0.50

I've tried it with Opera. The images don't display but I don't get an error message when saving a file (but the save doesn't work anyway).

I've looked long and hard but can't find any answers.
If any of you can help me, I'd be very grateful and I'll send you some funny videos.

This is my httpd.conf:
Code:
###*********************************************************
###*  DeveloperSide.NET                                    *
###*  http://www.devside.net                               *
###*  admin@devside.net                                    *
###*  v1.12                                                *
###*********************************************************


Listen 80
ServerRoot "/www/Apache2"
DocumentRoot "/www/webroot"

ServerName localhost:80
ServerAdmin admin@localhost

ServerSignature On
ServerTokens Full

DefaultType text/plain
AddDefaultCharset ISO-8859-1

UseCanonicalName Off

HostnameLookups Off

ErrorLog logs/error.log
LogLevel error

PidFile logs/httpd.pid

Timeout 300

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15


<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>


LoadModule access_module modules/mod_access.so
#LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
#LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
#LoadModule auth_anon_module modules/mod_auth_anon.so
#LoadModule auth_dbm_module modules/mod_auth_dbm.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
LoadModule headers_module modules/mod_headers.so
#LoadModule imap_module modules/mod_imap.so
#LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
#LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
LoadModule logio_module modules/mod_logio.so
LoadModule deflate_module modules/mod_deflate.so

LoadFile "/www/perl/bin/perl58.dll"
LoadModule perl_module modules/mod_perl.so
PerlRequire "/www/Apache2/conf/extra.pl"

LoadFile "/www/php/php4ts.dll"
LoadModule php4_module /www/php/php4apache2.dll


<Location />
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css
<IfModule mod_headers.c>
Header append Vary User-Agent
</IfModule>
</IfModule>
</Location>


<Directory />
Options None
AllowOverride None
Order allow,deny
Deny from all
</Directory>


<Directory "/www/webroot">
Order allow,deny
Allow from all
</Directory>


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

Alias /private "/www/private"

<Directory "/www/private">
<IfModule mod_autoindex.c>
Options Indexes
</IfModule>

Order allow,deny
Allow from all

AuthType Basic
AuthName "Private Access"
AuthUserFile "/www/private/.htpasswd"
require valid-user
</Directory>
</IfModule>


<IfModule mod_cgi.c>
ScriptAlias /cgi-bin/ "/www/cgi-bin/"

<Directory "/www/cgi-bin">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</IfModule>


Alias /phpMyAdmin "/www/phpMyAdmin"

<Directory "/www/phpMyAdmin">
Options None
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>


<Directory "/www/webroot/stats">
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>


<IfModule mod_log_config.c>
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-agent}i\"" combined
CustomLog logs/access.log combined
<IfModule mod_deflate.c>
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate.log deflate
</IfModule>
</IfModule>


<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>


<IfModule mod_mime.c>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-rar-compressed .rar
<IfModule sapi_apache2.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
</IfModule>


<IfModule mod_setenvif.c>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
<IfModule mod_deflate.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
</IfModule>


<IfModule mod_status.c>
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
</IfModule>


<IfModule mod_info.c>
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
</IfModule>


<IfModule mod_perl.c>
PerlModule Apache::Status
<Location /perl-status>
SetHandler perl-script
PerlResponseHandler Apache::Status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
</IfModule>


<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>


##### Start -- mod_perl Hello example, \www\perl\site\lib\Apache\Hello.pm
#
<IfModule mod_perl.c>
PerlModule Apache::Hello
<Location /hello>
SetHandler modperl
PerlResponseHandler Apache::Hello
</Location>
</IfModule>
#
##### End -- mod_perl Hello example


and my mime.types includes:
Code:
# MIME type Extensions
application/msword doc
application/pdf pdf
application/vnd.ms-excel xls
application/zip zip
image/bmp bmp
image/cgm cgm
image/g3fax
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/naplps
image/png png
image/prs.btif
image/prs.pti
image/svg+xml svg
image/t38
image/tiff tiff tif
image/tiff-fx
text/calendar ics ifb
text/css css
text/directory
text/enriched
text/html html htm
text/parityfec
text/plain asc txt
text/prs.lines.tag
text/rfc822-headers
text/richtext rtx
text/rtf rtf
text/sgml sgml sgm
text/t140
video/jpeg
Logged

i]I feel a lot more like I do now than I did half an hour ago[/i]
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: January 06, 2006, 04:37:04 PM »

Does this work...
http://127.0.0.1/IFC/images/NoImage.jpg

Check \www\Apache2\logs\error.log and access.log for more info.
IE will generate random errors to display to you if the server generated error message is less than 512 bytes (or around there).  The error.log will have the correct error msgs.

Also, this might be a permission problem, either on the access rights set to that directory (right click the dir and check it) or your IE zone settings.

How far off webroot will the images not be displayed (eg: does \webroot\noimage.jpg -- http://localhost/noimage.jpg display?).

And clear your browser cache.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Alec
Member
*
Posts: 12


View Profile
« Reply #2 on: January 08, 2006, 06:47:49 AM »

BigRat from experts exchange solved it for me:

Quote from: "BigRat"
It looks like you've got a broken WinSock dll on the machine. You'll need to put the directive "EnableSendfile Off" for the directory where the images come from in the Apache httpd.conf file. This happens often when something else gets installed and overwrites winsock2.dll


For the record:

http://127.0.0.1/IFC/images/NoImage.jpg  didn't work

No images of localhost would work regardless of their hierarchy.

Anyway, thanks for the help and here are those videos I promised :)
http://www.dailyhaha.com/_vids/pamela_Anderson.htm
http://www.dailyhaha.com/_vids/weirddogsounds.htm
http://www.dailyhaha.com/_vids/crazydog.htm
http://www.dailyhaha.com/_vids/Creative_Drummer.htm
Logged

i]I feel a lot more like I do now than I did half an hour ago[/i]
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #3 on: January 08, 2006, 03:25:21 PM »

Some versions of ZoneAlarm would cause this problem also -- as for the extra directive, check the thread at the top (about problems) which also covers this in some more detail.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Alec
Member
*
Posts: 12


View Profile
« Reply #4 on: January 09, 2006, 04:27:20 AM »

Quote from: "admin"
as for the extra directive, check the thread at the top (about problems) which also covers this in some more detail.


Which thread?
Logged

i]I feel a lot more like I do now than I did half an hour ago[/i]
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #5 on: January 09, 2006, 07:33:14 AM »

http://forums.devside.net/viewtopic.php?t=384
Quote from: "admin"
Another helpful bit from apache.org...

Problems Running Apache 2
http://apache.cs.utah.edu/httpd/binaries/win32/
Quote

If you encounter problems running Apache 2 under Windows, such as corrupted or incomplete file downloads, unexplained error messages, or a conflict with a software firewall, please place the following directives in httpd.conf to see if they eliminate the issue:

Code:

EnableSendfile Off
EnableMMAP Off
Win32DisableAcceptEx

Quote

The general problem is that many people install various add-ons to windows (such as software firewalls, virus checkers, etc) that break some of the advanced functionality that Apache uses to speed the sending of files. The above directives turn off the advanced functionality and make Apache fall back to more basic (but slower) techniques.


Win32DisableAcceptEx Directive
http://httpd.apache.org/docs-2.0/mod/mpm_winnt.html#win32disableacceptex
Quote

AcceptEx() is a Microsoft WinSock v2 API that provides some performance improvements over the use of the BSD style accept() API in certain circumstances. Some popular Windows products, typically virus scanning or virtual private network packages, have bugs that interfere with the proper operation of AcceptEx(). If you encounter an error condition like:

Code:

[error] (730038)An operation was attempted on something that is not a socket.: winnt_accept: AcceptEx failed. Attempting to recover.

Quote

you should use this directive to disable the use of AcceptEx().
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Alec
Member
*
Posts: 12


View Profile
« Reply #6 on: January 09, 2006, 08:24:31 AM »

Thanks
Logged

i]I feel a lot more like I do now than I did half an hour ago[/i]
Jerry
Member
*
Posts: 4


View Profile
« Reply #7 on: February 07, 2006, 12:16:24 PM »

I'm experiencing the same problem, when a Perl script writes the html
print "<img src=\"../webroot/apache_pb.gif\">\n";

I get the even though the path is correct.(i.e if I save the Perl produced html as a html doc and run that html doc the image displays fine)

As per suggestions here I've checked properties --> security for webroot and seems OK with perms. Also same problem encountered when running under XP admin privileges (used to install product). So I'm doubtful it's a permissions problem. Also the perl script does successfully import a subroutine from a sub webroot directory.

So then I added
   EnableSendfile Off
to the httpd.conf for the webroot directory - image still not displayed.

So I then added
   EnableSendfile Off
   EnableMMAP Off
   Win32DisableAcceptEx
to the httpd.conf for the webroot dir - this results in the 404 page not found instead.

NOTE: I did reboot each time the httpd.conf was modified.

Hmmm ... frustrating
[/img]
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #8 on: February 07, 2006, 03:50:49 PM »

The perl scripts are under \www\cgi-bin...
Which would make the html output here...
http://localhost/cgi-bin
So the relative URL path for file '\www\webroot\apache_pb.gif' should be something like...
Code:

print "<img src=\"../apache_pb.gif\">\n";


You are using a system path.  I think that might be your problem.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Jerry
Member
*
Posts: 4


View Profile
« Reply #9 on: February 07, 2006, 04:42:05 PM »

Well done again Admin. The path you gave worked & now I feel a bit of a muppet, particularly as I've still to get my head around as to why.

Thank you very much again.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!