From: <php...@li...> - 2010-08-04 13:08:58
|
hi, >From PHP 5.3.3, it bundles with the PHP-FPM(http://php-fpm.org/). I have setup PHP-FPM pools that work fine with Nginx, e.g. in Nginx, the following configuration connects to a PHP-FPM process: location ~ \.php$ { ... fastcgi_index index.php; fastcgi_pass unix:/my_path/php-fpm.sock; // also work when using port number ... Does PJB supports PHP-FPM? How to configure the FastCGIServlet to use it? by default, it seems to look for a "php-cgi" binary. Regards, mingfai |
From: <php...@li...> - 2010-08-04 13:36:27
|
Hi mingfai, I think we should wait until both, Fedora Linux and Windows PHP 5.3 binaries ship with php-fpm enabled. I haven't tested it, but the PHP/Java Bridge should work with php-fpm. Please either change the global.properties (see JavaBridge.jar zip file within JavaBridge.war zip file within the php-java-bridge_6.2.1_documentation.zip file) or start the JVM with the argument -Dphp.java.bridge.php_exec=php-fpm[.exe] or please change your WEB-INF/web.xml. Regards, Jost Bökemeier |
From: <php...@li...> - 2010-08-04 14:52:17
|
On Wed, Aug 4, 2010 at 9:36 PM, <php...@li... > wrote: > Hi mingfai, > > I think we should wait until both, Fedora Linux and Windows PHP 5.3 > binaries ship with php-fpm enabled. > > > I haven't tested it, but the PHP/Java Bridge should work with php-fpm. > > Please either change the global.properties (see JavaBridge.jar zip > file within JavaBridge.war zip file within the > php-java-bridge_6.2.1_documentation.zip file) or start the JVM with > the argument -Dphp.java.bridge.php_exec=php-fpm[.exe] or please change > your WEB-INF/web.xml. > > > Regards, > Jost Bökemeier > > Thanks for your reply. Yes, the current Windows binary doesn't contain php-fpm. I wonder if one build a Window binary from source, the php-fpm may work. The php-fpm executable/binary is to start pre-configured php process pool that each pool listen to a port/unix socket. I have a few sites using Nginx+PHP-FPM running apps like Wordpress. As I have started PHP-FPM manually, I think JavaBridge should not need to invoke the php-fpm(.exe) at all as any invoke will spawn additional "listener" instead of actually process/interpret php code. Instead, JavaBridge should connect to the listening port of any started php-fpm pool only. I tried to make PHP-FPM to listen to the default 9667, and the use_fast_cgi to disable autostart (used "no") but it still doesn't work. In readme, it mentioned: > If the parameter name "use_fast_cgi" is set to "Autostart" in the > web.xml, and a fcgi server does not listen on port 9667, and a fcgi > binary can be found as either > I assume a started php-fpm is a fcgi server. and I want to make JavaBridge use the fcgi server that i have started manually without trying to spawn any fcgi connection/process. does it make sense? do you know if php-fpm is a kind of fcgi server that JavaBridge may support? I'm trying to look at the source code to try to get this work. Now, I'm studying ContextLoaderListener and FastCGIServlet. Any pointer would be appreciated. Regards, mingfai |
From: <php...@li...> - 2010-08-05 09:56:27
|
> listening port of any started php-fpm pool only. I tried to make PHP-FPM to > listen to the default 9667, and the use_fast_cgi to disable autostart (used > "no") but it still doesn't work. "no" disables fastcgi altogether. Please set it to On. > I assume a started php-fpm is a fcgi server. and I want to make JavaBridge > use the fcgi server that i have started manually without trying to spawn any > fcgi connection/process. does it make sense? Yes, definitely. If you use PHP/Java Bridge version 6.2.1, remove php-cgi and then ask for some PHP page, the bridge will return an error message asking you to start a fastcgi server process. > do you know if php-fpm is a > kind of fcgi server that JavaBridge may support? Certainly. Just start it and configure the bridge to connect to its TCP port (Unix) or NamedPipe file (Windows). Or let the bridge decide which port or file to use and start the fastcgi process afterwards. > I'm trying to look at the source code to try to get this work. Now, I'm > studying ContextLoaderListener and FastCGIServlet. Any pointer would be > appreciated. In version 6.2.1 the configuration has been moved from the FastCGIServlet to the ContextLoaderListener, please see the NEWS file for details: http://php-java-bridge.cvs.sourceforge.net/viewvc/php-java-bridge/php-java-bridge/NEWS?revision=1.87&view=markup Regards, Jost Bökemeier |
From: <php...@li...> - 2010-08-05 14:06:22
|
On Thu, Aug 5, 2010 at 5:56 PM, <php...@li... > wrote: > > listening port of any started php-fpm pool only. I tried to make PHP-FPM > to > > listen to the default 9667, and the use_fast_cgi to disable autostart > (used > > "no") but it still doesn't work. > > "no" disables fastcgi altogether. Please set it to On. > > > > I assume a started php-fpm is a fcgi server. and I want to make > JavaBridge > > use the fcgi server that i have started manually without trying to spawn > any > > fcgi connection/process. does it make sense? > > Yes, definitely. If you use PHP/Java Bridge version 6.2.1, remove > php-cgi and then ask for some PHP page, the bridge will return an > error message asking you to start a fastcgi server process. > > > > do you know if php-fpm is a > > kind of fcgi server that JavaBridge may support? > > Certainly. Just start it and configure the bridge to connect to its > TCP port (Unix) or NamedPipe file (Windows). Or let the bridge decide > which port or file to use and start the fastcgi process afterwards. > .. > > > > Regards, > Jost Bökemeier > > thanks for your help. I'm about to get it work now. :-) one of the things I did it wrong before is I have configured the php-fpm pool with a chroot jail. the root path is changed by the chroot that JavaBridge has no knowledge about. regards, mingfai |