• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 2.x Branch ‹ General Support (v2.x)
  • Change font size
  • FAQ
  • Register
  • Login

404 package.json with root-relative path

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
3 posts • Page 1 of 1

404 package.json with root-relative path

Postby Craig » Mon Oct 29, 2012 10:09 pm

Hi,

I am trying to set up version 2.0.4 of phpfreechat on my site and having an issue with root-relative paths. I have the folder uploaded to /phpfreechat-2.0.4, so my server path is /phpfreechat-2.0.4/server

I am embedding the chat into a template, which can be used to create a page anywhere, so I need to use root-relative paths that start with /

I have added code as follows in the head:

Code: Select all
<link rel="stylesheet" type="text/css" href="/phpfreechat-2.0.4/client/themes/carbon/jquery.phpfreechat.min.css">
<script type="text/javascript" src="/phpfreechat-2.0.4/client/jquery.phpfreechat.min.js"></script>


with the following in the body:

Code: Select all
<div id="mychat"><a href="http://www.phpfreechat.net">phpFreeChat: simple Web chat</a></div>
         <script>
            jQuery('#mychat').phpfreechat();
            jQuery('#mychat').phpfreechat({ serverUrl: '/phpfreechat-2.0.4/server',
                                  check_server_config: true});
         </script>


This results in the chat trying to load (black area, with 'Unknown error' in a white box), but a 404 for http://mysite.com/package.json and http://mysite.com/check.php This is because the paths should be http://mysite.com/phpfreechat-2.0.4/package.json and http://mysite.com/phpfreechat-2.0.4/check.php

I have also tried using

Code: Select all
serverUrl: 'phpfreechat-2.0.4/server'


but it does not make a difference.

Can anyone explain what the problem is and how to fix it?

Thanks,

Craig
Craig
Member
 
Posts: 14
Joined: Mon Oct 29, 2012 9:48 pm
Top

Re: 404 package.json with root-relative path

Postby phpfreechat » Mon Oct 29, 2012 10:52 pm

Why do you have twice plugin activated ?

jQuery('#mychat').phpfreechat();
jQuery('#mychat').phpfreechat({ serverUrl: '/phpfreechat-2.0.4/server', check_server_config: true});

Only the second line should be enougth and it should work.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Re: 404 package.json with root-relative path

Postby Craig » Tue Oct 30, 2012 12:36 am

D'oh, why indeed. I must have mis-interpreted an example and not noticed. Works fine now.

Thanks.
Craig
Member
 
Posts: 14
Joined: Mon Oct 29, 2012 9:48 pm
Top


Post a reply
3 posts • Page 1 of 1

Return to General Support (v2.x)

Who is online

Users browsing this forum: No registered users and 8 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub