Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

fsockopen unable to connect to 127.0.0.1:9876 (Connection Refused) #630

Open
cam-spacebar opened this issue Mar 7, 2016 · 5 comments
Open

Comments

@cam-spacebar
Copy link

I've installed and configured Sulu on my dev machine (Mac, El Capitan with PHP 5.5)

I can run symfony apps without a problem, however the Sulu install creates this error in logs:

[2016-03-07 18:51:55] php.DEBUG: fsockopen(): unable to connect to 127.0.0.1:9876 (Connection refused) {"type":2,"file":"/Library/WebServer/Documents/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"level":28928} []

I've tried different ports, different sulu installations and done as much Googling possible and I'm unable to solve this problem.

@danrot danrot changed the title fsockopen unable to connect to 127.0.0.1:8000 (Connection Refused) fsockopen unable to connect to 127.0.0.1:9876 (Connection Refused) Mar 7, 2016
@danrot
Copy link
Contributor

danrot commented Mar 7, 2016

@camburns That sounds like a websocket issue... Does it work if you also run the command app/console sulu:websocket:run -e prod before accessing the website? And have you maybe set the confg sulu_content.preview.websocket to true?

@cam-spacebar
Copy link
Author

Thanks @danrot. I ran your command and Terminal gave me:
Websocket server started: "ws://sulu.lo:9876/<route>" bound to IP 0.0.0.0

and when browsing 0.0.0.0 on chrome I got the exception: "There exists no portal for the URL "http://0.0.0.0/"

I imagine this exception relates to a domain name issue and I'll need to do some debugging / learning more Sulu.

I wasn't able to find out where to edit sulu_content.preview.websocket. I unfortunately don't have experience around websockets.

Possible solution:
I was able to solve the problem by using the MAC apache server instead of php app/console server:run command, however I suspect many people will be using php app/console server:run to run Sulu and this will throw a lot of newbies off on first install.

@wachterjohannes
Copy link
Member

@camburns 0.0.0.0 is a wildcard ip. you websocket listen to all ips with the port 9876. you can not brows a websocket in chrome directly.

you can run sulu with the server:run command but you have to run it with the router argument app/console server:run -r app/config/router_admin.php this allows you to use the admin for website use the router_website.php file

@Nek-
Copy link

Nek- commented Nov 25, 2016

I'm not aware of all details but this issue occurs with PHP7 and Symfony Standard Edition. And it's a false positive generated by the following fact: Symfony uses fsockopen to check if the connection is already in use.

It's not a problem, just a standard check from Symfony. (that you can ask why, IDK)

@danrot
Copy link
Contributor

danrot commented Nov 29, 2016

Ah, i see, that's just a debug message... @camburns Is the live preview working for you? In case it is, that is not really an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants