Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-18-2005, 09:13 AM   #1
Registered: Jan 2005
Location: India
Distribution: Kubuntu Gutsy
Posts: 450

Rep: Reputation: 30
"Connection refused by localhost..." but why?

I was trying a simple php script for learning myself. The file was created in vi editor and the filename is 'hello.php'. The file is saved in /home/mydir directory. The script is as follows :
<title>php test</title>
<?php echo '<p>Hello World</p>'; ?>
Now if I want to run the file in Mozilla Firefox with "http://localhost/hello.php" then it shows an alert "The connection was refused when attempting to contact localhost".

Please help me with your opinion what is the mistake I am doing.

Old 03-18-2005, 09:21 AM   #2
Registered: Dec 2004
Location: Western Pennsylvania, USA
Distribution: Red Hat
Posts: 150

Rep: Reputation: 15
The only way you would be able to access the file like that would be if you were running a web server on your machine and /home/mydir was the default directory for the web server.
Old 03-18-2005, 12:30 PM   #3
Registered: Jan 2005
Location: India
Distribution: Kubuntu Gutsy
Posts: 450

Original Poster
Rep: Reputation: 30
Actually I am not able to httpd on. Is the problem generating from this? If I want to turn on httpd service then I am getting an error message
httpd failed. The error was: Starting httpd: /usr/sbin/httpd: error while loading shared libraries: cannot open shared object file: No such file or directory


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS problem! "localhost:631, connection refused"!!! robbow52 Debian 5 03-04-2009 02:27 PM
ircd.conf: "Connection failed. Error: Connection refused" hamish Linux - Software 3 03-10-2005 08:23 AM
What is "Xlib: connection to ":0.0" refused by server " rack201 Linux - Software 1 02-04-2004 08:49 AM
lp filename yields "cannot open connection to localhost - Connection refused" jjge Linux - General 3 12-29-2003 12:02 AM
"connection refused" on port 993, when not coming from localhost spam4scott Linux - Networking 2 07-14-2003 07:35 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration