Does Ratchet\Xampp\XamppServerInterface exist???

671 views
Skip to first unread message

Winnie Nakimuli

unread,
Apr 20, 2013, 3:43:38 AM4/20/13
to ratch...@googlegroups.com
I am using Xampp on ubuntu and i am trying out the push intergration in the Ratchet documentattion can i use  Ratchet\Xampp\XamppServerInterface???

cboden

unread,
Apr 20, 2013, 9:39:38 AM4/20/13
to ratch...@googlegroups.com
XAMPP is a synchronous server stack.  Ratchet is an asynchronous stack.  You can not combine code together, they must run in parallel.  The push tutorial explains how the two separate processes can speak to each other.  XAMPP is just a bundle that install Apache, MySQL and PHP.

Winnie Nakimuli

unread,
Apr 20, 2013, 10:28:22 AM4/20/13
to ratch...@googlegroups.com
so it's ok to use Ratchet\Wamp\WampServerInterface when using Xampp am sorry to ask but am new to programming, then also where do i save the entrydata stuff because the tutorial does not say?? so i saved it in the src/MyApp/ hope that is ok then when i run push-server.php it brings Fatal error: Class 'React\ZMQ\Context' not found in /opt/lampp/htdocs/bin/push-server.php on line 7
 i have tried everything, i was able to install ZeroMQ as per their website and i installed it in htdocs folder please i need help
For my class project we need a websocket enabled server that should be able to push realtime updates to a client and we want to high charts and google maps to display this changing data on the client, if you could please advice me on the best way to go about this because for now i already have my php script with the random generator and now i need to know how to push this data to the client, but the push integration example is giving me the error above.





--
 
---
You received this message because you are subscribed to a topic in the Google Groups "Ratchet" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ratchet-php/4KZ62-vPYqM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ratchet-php...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

cboden

unread,
Apr 20, 2013, 12:18:24 PM4/20/13
to ratch...@googlegroups.com
Given the error on line 7 it sounds like you either forgot to include react/zeromq in your composer.json file or forgot to include the autoload.php file in push-server.php.

The "WAMP" in WampServerInterface stands for "WebSocket Application Messaging Protocol" which is a json based pub/sub+rpc sub-protocol.  It is not the same as the WAMP (Windows Apache MySQL PHP) acronym that you are thinking of.  The push tutorial will work with your XAMPP synchronous stack, but there is no XamppServerInterface nor do you need one.

Winnie Nakimuli

unread,
Apr 20, 2013, 1:25:11 PM4/20/13
to ratch...@googlegroups.com
Thank you for your response, when i run php composer.phar update this is what i get  
Problem 1
    - Installation request for react/zmq dev-master -> satisfiable by react/zmq dev-master.
    - react/zmq dev-master requires ext-zmq * -> the requested PHP extension zmq is missing from your system.
 when i edit phpini() file adding extension=/opt/lampp/htdocs/zeromq-3.2.2/zmq.so i get an error can't create object file am not sure how to proceed with this

cboden

unread,
Apr 20, 2013, 3:51:08 PM4/20/13
to ratch...@googlegroups.com
Composer is complaining because it requires the zmq extension to be properly installed.  I'm not sure how to deal with the other error you are receiving, which is PHP complaining it can't load the zmq extension. You should check the ZeroMQ documentation or mailing list for help there; as I have not come across that error before. 

Winnie Nakimuli

unread,
Apr 20, 2013, 3:53:37 PM4/20/13
to ratch...@googlegroups.com

Winnie Nakimuli

unread,
Apr 20, 2013, 3:57:02 PM4/20/13
to ratch...@googlegroups.com
ok, thank you i will just check out their Documentation , mean while i wanted to ask where do you save the file with $entry data??? is it in MyApp or bin not sure??? sorry for asking even small questions am just trying to understand how this stuff works


Thank you for your response

cboden

unread,
Apr 20, 2013, 3:58:58 PM4/20/13
to ratch...@googlegroups.com
That file is in your website (with your code for XAMPP) with any name you like.  It is hit when the user _POST's to your endpoint of choice.  The demo just calls it post.php

jacobron...@gmail.com

unread,
Jun 19, 2013, 5:41:25 PM6/19/13
to ratch...@googlegroups.com

So what happened for me is that in the previous step where your supposed to install the PHP binding library, i was receiving errors when I did $ make && make install step in this set of instructions:

Building PHP Binding from GitHub http://www.zeromq.org/bindings:php

....the reason for these errors was that php.h file was not found.  Now even though your server might have php installed on it, the source code may not be available.  So I followed these steps below from stackoverflow to install my php source code onto MAMP( in your case whatever server your using). 

http://stackoverflow.com/questions/10717752/having-problems-while-try-to-install-oauth-with-pecl-in-mamp-on-mac-os-lion

Stackoverflow

Here's how I fixed it:

  1. MAMP doesn't provide the source code archive for PHP 5.4.10 so download it from php.net
  2. Extract the source code archive to /Applications/MAMP/bin/php/php5.4.10/include/php
  3. Run ./configure to configure the source code for your platform (without this step the pecl install will fail looking for a bunch of header files)
  4. Retry your pecl install
After this i did the Make && make install....went to composer and it worked

hope this helps 
Reply all
Reply to author
Forward
0 new messages