I am implementing socket.io in an Open Source PHP application. But socket.io is not work directly on PHP server.
In their document they have proposed a PHP solution, and its look fine. but main problem is that their propesed solution: https://github.com/rase-/socket.io-php-emitter need two PHP extensions to be installed msgpack-php and phpredis. And this extension are generally not installed in PHP server.
As my application is Open Source and most of our user will use it on shared hosting, where they are not allowed to install any PHP extensions.
My question is
Is there any PHP client library for msgpack-php and phpredis with easy integartion.
OR
Is there any PHP REAL-TIME ENGINE for pusing content to client side ?
Thanks for being helpful.
Related
I am trying to use php on my website but I am wondering if I could use it without downloading it. I've already surfed the internet for a answer, but none of them had a clear answer. Please help!
To start using PHP, you can:
Find a web host with PHP and MySQL support OR
Install a web server on your own PC, and then install PHP and MySQL
If your server has activated support for PHP you do not need to do anything.
Just create some .php files, place them in your web directory, and the server will automatically parse them for you.
You do not need to compile anything or install any extra tools.
Because PHP is free, most web hosts offer PHP support.
Source: https://www.w3schools.com/php/php_install.asp
Integrating PHP java bridge, facing some issue while restarting Apache server as showing error:
The procedure entry point php set error handling could not be located in dynamic link library C:\xampp\php\ext\php_java.dll
I made the changes outlined below in my php.ini file and copied JavaBridge.jar and php_java.dll in C:\xampp\php\ext.
extension=php_java.dll
[java]
java.java_home = "C:\Program Files\Java\jdk1.8.0_131\bin"
java.java = "C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe"
java.class.path = "C:\xampp\php\ext\JavaBridge.jar"
java.library.path = "C:\xampp\php\ext"
java.log_level =2
Specific to your question:
First of all, the javabridge communication is not handled anymore by a php extension (I mean the php_java.dll or java.so).
So you simply don't need it, you can completly remove the "extension=php_java.dll" as this has been replaced by a pure php implementation known as the Java.inc client (or alternatively the soluble-japha client).
I believe you use a very old documentation... So don't spend too much time in this direction because you'll probably won't have support.
But if you want to work with the javabridge, just remember you'll have to install both:
a Java server that will expose the Java virtual machine on a network port (standalone or deployed on Tomcat)
a PHP client library on the PHP side that will establish communication with the server (Java.inc or soluble-japha)
I suggest you to read the docs on the official php-java-bridge website to get some insights about installation (or alternatively some docs for the unofficial soluble-japha project, they work pretty much the same way).
And first ensure, the php-java-bridge server is sucessfully running. The php-java-bridge files can be downloaded either:
Option 1: The war file (tomcat only) is here
Option 2: Individual files for cli/standalone server are here
Once it works, try to connect from PHP.
You'll probably face a lot of problems at first run, but from there it will be easier to answer your questions.
Good luck
As I was developing a php app I realised that my app is slow in terms of processing large sets of data in the catche. Decided to do something about it and went on to google to find some sort of solution or at least suggestions.
I came across Redis, after reading about it I would realy like to give it a go and test it out as it looks promising,
But I also stumbled into predis and phpredis, and thats when I begun to get confused. From what I understand i need predis or phpredis with my php app, but then where do I use Redis....? how should I build my stack...?
Redis->predis->php
Do I have to install both Redis and Predis/phpredis within my PHP directory in eg. lib dir..?
Also is there any significant difference between Redis and Phpredis
Redis is a standalone caching application: http://redis.io/ (plenty of documentation on how to install)
predis is a library for interacting with a running Redis application easily from within php. Phpredis is similar but requires compiling.
You can think of it like MySql and PHP. MySql is it's own application that you are able to communicate with via a PHP extension, MySql itself is not a part of PHP.
Your stack could be (apache / php5.3 / mysql / redis) with just the predis library.
You can run redis either on the same server or a different server, it's up to you.
Redis is a server that runs independently from your application (i.e. PHP) code. You can download it from here.
To talk to Redis, your application can do one of the following:
Implement Redis' protocol, i.e. RESP
Use a client library
Most people go for option 2, which in PHP's case your options would be predis, phpredis or any of the other clients in the clients page or others that are unlisted by you can find in GitHub.
I just fail to understand why couchbase does not provide a php extension for use on "windows" & IIS 7. Is there some efficient other ways of connecting & working with couchbase using php on windows?
I just set up the Couchbase client library today (PHP 5.4 NTS under IIS7). The directions posted at Couchbase's page for the PHP Client Library are accurate for the most part but I wanted to clarify where the dlls go.
Download the zip containing php_couchbase.dll and libcouchbase.dll. Generally you will want the NTS (non-thread safe) version under IIS.
Put php_couchbase.dll in the extensions directory.
Put libcouchbase.dll in the php directory (same directory as php.exe/php-cgi.exe).
If necessary, install the Visual C 9 runtime from Microsoft.
Enable the extension in php.ini
I initially put libcouchbase.dll in the extensions folder per the directions on the Couchbase site. That will not work. (Generates the PHP "the specified module could not be found" dll load error.)
The above only gives you the Couchbase client. You also need a server; that can be locally on the Windows machine or somewhere else.
The Couchbase client SDKs are quite important because they are "cluster aware".
The SDKs, including the PHP one will automatically use all the nodes of the cluster using vBuckets and they will be notified when the topology changes (add new nodes, failover, ...)
Also if you are using Couchbase 2.0 the SDK provides you API to call the views and do more advanced queries on documents.
So the best practice is to use the PHP SDK, that use internally the memcached protocol.
I am inviting you to read:
- http://www.couchbase.com/docs/couchbase-devguide-2.0/couchbase-clients.html
- http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-introduction-architecture-vbuckets.html vBuckets used to manage the auto-sharding.
- http://www.couchbase.com/develop/php/next the PHP SDK main page
A more advanced topic that explains how to developer a client SDK:
- http://www.couchbase.com/docs/couchbase-devguide-2.0/creating-client-library.html
I suppose you are referring to Couchbase 1 (and not the 2.0 version which is currently in Beta).
Couchbase is compatible with memcached. That means you can use any memcached-compatible client to access it, e.g. PHP's memcache or memcached functions.
Update:
If you want to get your hands dirty and compile the PHP extention for the Couchbase SDK yourself, here is a tutorial that guides you through the process.
Are there any "all-in-one" installers for php + mysql on iis? Preferably with a gui configuration interface.
The PHP part is easy with Web Platform Installer:
http://php.iis.net/
MySQL is a breeze to install on Windows:
http://dev.mysql.com/downloads/mysql/5.1.html#win32
I don't know of any all-in-one installers for both MySql and PHP, but PHP itself comes with an automated installer that will attach itself to IIS - but the preferred method is still manual (the automated procedure only uses CGI). There are plenty of how-to pages on the web that give you the step-by-step procedure required to get setup (and these differ based on your version of IIS) - I suggest you use one of those instead.
Some links to get you started:
PHP Documentation
Installing PHP 5 on IIS in 5 simple steps
I know this is not a direct answer, but a point of interest only. If you are looking for something that runs php/mysql that is quick to get setup for testing purposes you could try using a virtual appliance+vmware server/player
I don't know of any all in one installers, but you are probably better off just installing MySQL and PHP seperately. It's pretty straight forward.
MySQL has a GUI installation wizard in windows. I'm assume you know where to download this. You can download PHP for IIS from the Microsoft website here. It will have a GUI interface to some extent for installation:
http://www.microsoft.com/web/gallery/install.aspx?appid=PHP53
You will probably need to still reference MySQL by editing the php.ini file manually. This is a particually good FAQ:
http://learn.iis.net/page.aspx/353/install-and-configure-mysql-for-php-applications-on-iis-7-and-above/