Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Currenty there is no connection to the server. reconnecting in 10 #28

Closed
nishanth6 opened this issue Oct 3, 2018 · 8 comments
Closed
Assignees
Labels
investigated This issue is being looked at. reproduced

Comments

@nishanth6
Copy link

As I'm using xampp server

config.php

`<?php
date_default_timezone_set('EUROPE/AMSTERDAM');

define ('DATABASE_HOST', 'localhost');
define ('DATABASE_USERNAME', 'root');
define ('DATABASE_PASSWORD', '');
define ('DATABASE_DB', 'socket_chat');
define ('ENABLE_DATABASE', true);

/**

  • The host can either be an IP or a hostname
  • on this machine. The port is just the port
  • plain and simple.
    */
    define('CHAT_SERVER_HOST', '127.0.0.1');
    define('CHAT_SERVER_PORT', '80');

`
I tried to run aa

http://localhost/chat/chat/index.php

Got the Error as

Error: Currenty there is no connection to the server.
reconnecting in 10

@johnnymast
Copy link
Owner

Hey @nishanth6,

Did you run the server as well ?

@johnnymast johnnymast self-assigned this Oct 3, 2018
@johnnymast johnnymast added the investigated This issue is being looked at. label Oct 3, 2018
@nishanth6
Copy link
Author

@johnnymast
Yes, I had xammp server running with MySQL. and I also imported the DB and in config
define ('ENABLE_DATABASE', true);

@johnnymast
Copy link
Owner

Maybe you should switch off the database (for now) and try again to eliminate possible errors.

@johnnymast
Copy link
Owner

Alright i have spotted the error.

  1. change CHAT_SERVER_PORT back to 8080
  2. Set XAMPP up and point it to the directory with index.php
  3. On the command line start php ./server.php

This will run index.php from xampp, this creates html and will connect to the server on port 8080. So server.php will bind to port 8080.

@nishanth6
Copy link
Author

nishanth6 commented Oct 4, 2018

capture

No Good it didn't solved the problem

@johnnymast

@johnnymast
Copy link
Owner

Is your version on github ?

@johnnymast
Copy link
Owner

@nishanth6 is your index.php located in the root of your webserver? (and not something like /chat/index.php)? Im asking because:

<script type="text/javascript" src="/js/dom.js"></script>
<script type="text/javascript" src="/js/websockets.js"></script>
<script type="text/javascript" src="/js/interface.js"></script>

If your document root is /chat (or something) then these files and the stylesheets are not found. You might want to change the script urls or your document root.

johnnymast added a commit that referenced this issue Oct 10, 2018
…ect.

 - Scripts and Stylesheets are now relative to the directory your hosting it in. So that the project can be hosted in sub directories for example chat/index.php. Fixing #29 and #28.
 - Cleaned up the HTML code. fixing #30
@johnnymast
Copy link
Owner

This issue will be resolved in version 1.4. For now remove the prefix / from the local script and css links in the html and you will be good to go.

Happy coding ! :octocat: 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigated This issue is being looked at. reproduced
Projects
None yet
Development

No branches or pull requests

2 participants