Localhost Refused to Connect Error
Posted by: kam (197.204.169.---)
Date: August 01, 2023 04:58PM

Hello!

I'm using WampServer version 3.2.4.9 (64-bit) on my system (windows 11 64-bit). I'm working on a WordPress project named "siat," and I'm trying to set it up locally. However, I'm encountering some issues. Here's what I've done so far:

1. I placed my "siat" project inside the "www" folder of WampServer.
2. I created a database using phpMyAdmin and successfully imported the required tables.
3. In the "wp_options" table of the database, I updated both "siteurl" and "home" values to "[localhost]; to ensure the correct URL.

Despite these configurations, when I type "localhost/siat" in my web browser, it gives me an error message saying, "localhost refused to connect," and "ERR_CONNECTION_REFUSED."

I would greatly appreciate any guidance or insights on how to resolve this issue and get my local WordPress website running successfully.

Thank you in advance for your help!

Options: ReplyQuote
Re: Localhost Refused to Connect Error
Posted by: RiggsFolly (Moderator)
Date: August 01, 2023 05:27PM

You need to create a Virtual Host to house your project See This sticky post to get you started.

Couple of things that were not clear in your description.

Quote

I placed my "siat" project inside the "www" folder of WampServer.
Do you mean you added a folder called `siat` under the `www` folder? Or do you mean you put the Wordpress code into the `www` folder itself?

NOTE: It is also useful if you answer all these question READ (and answer) BEFORE YOU ASK A QUESTION So we know a little more detail about your specific implementation. Remember WAMPServer can host multiple versions of all the servers and PHP interpreter.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 08/01/2023 05:28PM by RiggsFolly.

Options: ReplyQuote
Re: Localhost Refused to Connect Error
Posted by: Otomatic (Moderator)
Date: August 01, 2023 08:17PM


Options: ReplyQuote
Re: Localhost Refused to Connect Error
Posted by: kam (105.98.249.---)
Date: August 01, 2023 09:08PM

I am using :
1 - Windows 11( 64 bit)
2 - Version WampServer 3.2.4.9 ( 64 bit)
3 - Apache Version 2.4.54.2
4 - PHP Version 8.0.26
5 - MySQL Version 8.0.31
5a - MariaDB version 10.10.2
6 - the color of the WampServer icon is green
7 - yes I have access to localhost
7a - there is no error message at the bottom of the page

8 -yes , I have access to phpMyAdmin

9 - If you refer to an error message, please include the EXACT wording of the error in your post
the error is when I try to type localhost/siat I get :

Sorry, unable to access this page.
localhost refused the connection.
Try:
Checking your internet connection.
Verifying your proxy and firewall settings.
ERR_CONNECTION_REFUSED.


10 - the full path to the installation of WampServer ( C:\wamp64)

to answer your question :
yes my wordpress code is inside the siat folder , and the siat folder is inside the www folder , isn't this how we are supposed to do ?

Options: ReplyQuote
Re: Localhost Refused to Connect Error
Posted by: kam (197.204.124.---)
Date: August 02, 2023 11:57AM

I think I know where the problem is .

When I access my site using "localhost/siat," it automatically redirects to "[localhost]; even though SSL is disabled in WordPress. I have already changed the "siteurl" and "home" options in the "wp_options" table to "[localhost]; (without the "s" in "https"winking smiley

I have also cleared my browser cache to rule out any caching-related problems.

I also tried to disable SSL from Apache in "http-ssl.conf" by setting "SSLEngine off," but unfortunately, the issue persists.


Please note that I can access "localhost/siat/wp-login.php" with no errors. The HTTPS redirection problem only seems to occur on the homepage.



Edited 1 time(s). Last edit at 08/02/2023 12:23PM by kam.

Options: ReplyQuote
Re: Localhost Refused to Connect Error
Posted by: RiggsFolly (Moderator)
Date: August 02, 2023 01:38PM

Remember, WordPress keeps the url in its database, you may need to change those records. It is a process well documented on the wordpress site under "Moving your site"

Of course it would be better to create a Virtual Host, then install your WP into that. And then you can make it a HTTPS site as well

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Localhost Refused to Connect Error
Posted by: Otomatic (Moderator)
Date: August 02, 2023 02:11PM

Hi,

> When I access my site using 'localhost/siat', it automatically redirects to 'https://localhost/siat'
- 1 - It may be the WordPress .htaccess file that forces the redirection to 'https', but it may also be a setting in the browser you're using.

- 2 - As already explained and as with all hosting providers, you need to use VirtualHost for your local sites.

Previously, I gave you three links on this subject. Read the relevant explanations and apply them to your WordPress site.

With a hosting company, you would go to your site via 'http://siat/' and not via 'http://gandi/siat/' or 'http://hostinger/siat/' or 'http://planethoster/siat/'. So, locally, it should be 'http://siat/' and not 'http://localhost/siat/'.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.