AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

PHP client interface problems
 
 

Hi Bruce, hi Wade, hi all,

I have problems to get the PHP-client working.
A problem which I can´t even solve with Daves help,
so Dave made the proposal to post it here.

I downloaded the server to my CS-folder,
put exceptions in windows-security, zonealarm and Antivir.

After that, I started xampp and localserver.bat,
localhost/chatscriptclient.php in Chrome
and had no output, typing in:

“Test.” which should give me the answer:
“Dies ist ein Test-Output.” (This is a test-output.).

After that, I tried my luck with a :build 0
and recieved an answer, but none I expected:

“Hey, sorry. There was a salesman at the door. Where were we?”

and a message in its own box written over it:
“unknown software-fault (0xc0000417) occured at the place 0x0047dc46.”

After that, my input trials “:build 1” and “test” showed me this:

Warning: fsockopen(): unable to connect to localhost:1024
inC:\xampp\htdocs\chatscriptclient.php on line 61

Fatal error: Error opening socket in C:\xampp\htdocs\chatscriptclient.php on line 62

xampp´s error log tells me:

“[Fri Aug 09 18:04:46.781250 2013] [ssl:warn] [pid 3268:tid 1844] AH01909: RSA certificate configured for http://www.example.com:443 does NOT include an ID which matches the server name”

Perhaps someone here has an idea what I can do to solve the problem.

Best

Andreas

 

 
  [ # 1 ]

Andreas, I may have failed to mention it, but you can ignore the SSL warning. It’s not related to ChatScript, and it’s a common occurrence with XAMPP servers.

The real issue here is that the ChatScript server acts as if it’s not operating on the correct port, once :build 1 is executed. I’ve tested the PHP script on my local computer with exactly the same configuration that Andreas has, and the script works fine for me. the only difference is that my CS server runs Morti (sort of), while Andres’ runs his chatbot, Maldix. I’m pretty sure our installs both use the same default file (the one that’s accessed when you type in :build 0), so I think it’s down to the chatbot, but how would a difference there cause the CS server to actively refuse a connection? When Andreas runs ChatScript “locally” (e.g. not via the server), it seems to work fine. I’ve done what I could think to do, so I’m now at a loss.

 

 
  [ # 2 ]

No script you write can affect port behavior. You can only write script that crashes the server (regardless of client used). No script can cause the server to refuse a connection.

 

 
  [ # 3 ]
Andreas Drescher - Aug 9, 2013:

Hi Bruce, hi Wade, hi all,

I have problems to get the PHP-client working.
A problem which I can´t even solve with Daves help,
so Dave made the proposal to post it here.

I downloaded the server to my CS-folder,
put exceptions in windows-security, zonealarm and Antivir.

After that, I started xampp and localserver.bat,
localhost/chatscriptclient.php in Chrome
and had no output, typing in:

“Test.” which should give me the answer:
“Dies ist ein Test-Output.” (This is a test-output.).

After that, I tried my luck with a :build 0
and recieved an answer, but none I expected:

“Hey, sorry. There was a salesman at the door. Where were we?”

and a message in its own box written over it:
“unknown software-fault (0xc0000417) occured at the place 0x0047dc46.”

After that, my input trials “:build 1” and “test” showed me this:

Warning: fsockopen(): unable to connect to localhost:1024
inC:\xampp\htdocs\chatscriptclient.php on line 61

Fatal error: Error opening socket in C:\xampp\htdocs\chatscriptclient.php on line 62

xampp´s error log tells me:

“[Fri Aug 09 18:04:46.781250 2013] [ssl:warn] [pid 3268:tid 1844] AH01909: RSA certificate configured for http://www.example.com:443 does NOT include an ID which matches the server name”

Perhaps someone here has an idea what I can do to solve the problem.

Best

Andreas

I’m not using XAMPP, I am using WAMP and works fine.

Are you using SSL? If not, try commenting it out in your httpd.conf file:

#Include conf/extra/httpd-ssl.conf

Restart the server and report any other errors

 

 
  [ # 4 ]

Hi all, thank you for thinking it over with me.

Hi Jaz, no i am not using SSL and iI have

done, what you were proposing,
but there is still no output at all.
Not even the “salesman”-output,
which I have never written: )


This is what I found on the xampp-error-log:

[Fri Aug 09 23:22:56.437500 2013] [ssl:warn] [pid 1156:tid 208] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Aug 09 23:23:00.765625 2013] [mpm_winnt:notice] [pid 1156:tid 208] AH00455: Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16 configured—resuming normal operations
[Fri Aug 09 23:23:00.812500 2013] [mpm_winnt:notice] [pid 1156:tid 208] AH00456: Server built: Feb 23 2013 13:07:34
[Fri Aug 09 23:23:00.812500 2013] [core:notice] [pid 1156:tid 208] AH00094: Command line: ‘c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Fri Aug 09 23:23:01.437500 2013] [mpm_winnt:notice] [pid 1156:tid 208] AH00418: Parent: Created child process 2792
[Fri Aug 09 23:23:07.000000 2013] [ssl:warn] [pid 2792:tid 1860] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Aug 09 23:23:07.437500 2013] [mpm_winnt:notice] [pid 2792:tid 1860] AH00354: Child: Starting 150 worker threads.

 

 
  [ # 5 ]

All of that looks fine, Andreas. The first entry is still related to SSL, so can be ignored. The rest are just typical information that’s logged every time the server starts, so again, no problem.

My next suggestion would be to go ahead and delete the new ChatScript folder (you still have the original one, I trust), download the latest version from SourceForge, place it in a location that’s different from the original (so as not to overwrite any files), and configure it as needed but do not add your chatbot yet. Then start that CS server instance and try the PHP interface again. If it works, then great! try adding Maldix, and see if it still works. If it doesn’t, then we can investigate further.

By the way, I’ve split this thread in two, to deal with Andreas’ issue independently from the original thread.

 

 
  [ # 6 ]

Can you make sure that the windows CS server is listening on port 1024?

Steps:

1. Run “SERVER BATCH FILES/LocalServer.bat”
2. Open a Command Prompt (Start >> Run >> cmd)
3. Type the following command:

netstat ---find "1024" 

or to see an entire listing of all your ports:

netstat ---

4. You should be able to find 0.0.0.0:1024 like the following:

C:UsersJasper>netstat ---find "1024"
  
TCP    0.0.0.0:1024           0.0.0.0:0              LISTENING       7228
  TCP    0.0.0.0
:10243          0.0.0.0:0              LISTENING       4
  TCP    [
::]:10243             [::]:0                 LISTENING       4 

The numbers to the right of ‘LISTENING’ is the “process ID”

If you want to make sure that port 1024 corresponds to chatscript.exe:

1. Open up the Task Manager (CTRL+SHIFT+ESC)
2. Click the “Processes” tab
3. Select “View >> Select Columns” and select ‘PID (Process Identifier)’
4. You should be able to see the process ID of chatscript.exe

You should see something like (7228 corresponds to chatscript.exe in this case):

7228   chatscript.exe *32   administrator    50    161,776K    chatscript.exe 

 

 

 

 

 
  [ # 7 ]

Hi Dave,

I did what you were proposing,
but I had the same problem:
no answer after typing in “Hello.”
and the same “unable to connect”-
message after a “:build 0”.

Hi Jaz,

after trying

netstat -a -n -o | find “1024”

I recieved:

C:\Dokumente und Einstellungen\Maldix>netstat -a -n -o | find “1024”
  TCP   0.0.0.0:1024       0.0.0.0:0         ABHÖREN       2448

but when I am not able to reach the area
in my task-manager you are talking about:

left-click on “Name” (German for “Processes):
task-manager changes the order of processes i see.

right-click on “Name”: taskmanager gives my a choice between:
kill process / kill process-structure and / Priority

Maybe a little bit stupid
but Yours

Andreas

 

 
  [ # 8 ]

It looks like the port 1024 is in use by PID 2448.

If you can verify or not that PID 2448 belongs to chatscript.exe may explain why you’re not able to connect.

Can you add the PID to your task manager using this guide?
http://www.myitforum.com/articles/1/view.asp?id=5254

Also, what version of windows are you using?

 

 
  [ # 9 ]

I am using XP,
perhaps this is the reason why my taskmanager only shows:
Name (of the program)
Benutzername (username)
CPU-Auslastung (operating grade CPU)
Speicherauslastung (operating grade repository)
and “rpzess beenden” (end process).
No “file”, “options”, “view” oder “help”
an no possibility to open “processes”.

Thank you very much.
I will be back on monday.

Andreas

 

 
  [ # 10 ]

In XP, once you open Task Manager, you can add the PID column this way:

1.) In the Task manager menu bar, press Ansicht
2.) Scroll down and select Spalten auswählen
3.) locate the checkbox labeled identifizieren Prozess and make sure it’s checked

If all goes well (and if Google Translate didn’t let me down), you should now see the Proces ID’s for each item shown.

Hope this helps.

 

 
  [ # 11 ]

Before you run LocalServer.bat, try running netstat -ano | find “1024” to check if it’s already being used. 

You could also just try changing the ports on the server LocalServer.bat and the PHP Client files.

Use netstat -a -n -o to see which ports are being used and then pick something else.

 

 

 
  [ # 12 ]

Hi Dave, hi Jaz,

I now learned how to get back
my hidden windows of the task-manager!
And did what you said:

neither by “process-ID”
nor by “netstat -ano | find “1024”
I see a running 1024,

BUT

if am running localserver.bat
its process-PID is 3592.
Perhaps this is the problem.

If “yes”: How can I change it to 1024?

Best

Andreas

 

 
  [ # 13 ]

You don’t need to change that number. That’s the process ID that the server is attached to. What you need to do now is check to make sure that process ID is what’s listening on port 1024. To do that, ypou need to open a command prompt and type in:

netstat -ano | find “1024”

and see if the process ID is the same as that. If it is, then we know that the problem is somewhere within the ChatScript server. If it is not the process ID that’s shown, you can open the task manager to see what IS listening on that port.

Once you find out what’s happening, please let us know.

 

 
  [ # 14 ]

Hi Dave,

if localserver.bat is running the result of “netstat -ano | find “1024” is:

  TCP   0.0.0.0:1024       0.0.0.0:0         ABHÖREN       2988

if not, there is no result.

Best

Andreas

 

 
  [ # 15 ]

One thing to bear in mind is that every time you start a program, the Process ID is very likely to change.


Let’s try this:

1.) in a command window, type in the following:
    netstat -ano | find “:34254”
    (we’re trying to make sure there is nothing using port 34254)
2.) if there is, try to use another number that’s higher than 32768 until you get no results from netstat
3.) once you find an unused port in that range, right-click localserver.bat (the batch file to start the ChatScript server) and change the port setting in the batch file to match the port number you’ve found
4.) open the PHP interface script and do the same there
5.) start the ChatScript server
6.) try the PHP client again, and see what happens

 

 1 2 3 > 
1 of 3
 
  login or register to react