Am using Tomcat 6. I have installed PHP and try to get PHP running inside Tomcat with PHP/JavaBridge. I have deployed JavaBridge.war inside Tomcat's webapps directory. When running any PHP script, I will get this error below. Please help and I thank you for your assistance.
This was how I configure PHP:
./configure --with-mime-magic
--with-config-file-path=/usr/local/Zend/etc
--with-apxs2=/usr/local/apache2/bin/apxs
--with-libxml-dir=/usr
--with-mhash=/usr/local
--with-bz2=/usr
--with-curl=/usr
--with-gettext=/usr
--with-mysql=/usr/local/mysql
--with-mcrypt=/usr/local
--enable-magic-quotes
--enable-bcmath
--enable-calendar
--enable-ftp
--enable-sockets
--enable-wddx
--enable-mbstring
--enable-zip
--enable-exif
--with-gd=/usr
--with-freetype-dir=/usr
--with-jpeg-dir=/usr
--with-png-dir=/usr
--enable-gd-native-ttf
--enable-fastcgi
--enable-force-cgi-redirect
The error msgs from Tomcat as follows:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
javax.servlet.ServletException:
php.java.bridge.http.FCGIConnectException: Could not connect to server
php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:133)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
java.lang.Thread.run(Thread.java:662) root cause
php.java.bridge.http.FCGIConnectException: Could not connect to server
php.java.bridge.http.SocketChannelFactory.test(SocketChannelFactory.java:58)
php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:131)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
java.lang.Thread.run(Thread.java:662) root cause
java.io.IOException: java.net.ConnectException: Connection refused
php.java.bridge.http.FCGIConnectException.(FCGIConnectException.java:37)
php.java.bridge.http.SocketChannelFactory.test(SocketChannelFactory.java:58)
php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:131)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
java.lang.Thread.run(Thread.java:662) root cause
java.io.IOException: PHP not found. Please install php-cgi. PHP test
command was: [php-cgi, -v]
php.java.bridge.Util$Process.start(Util.java:1145)
php.java.servlet.fastcgi.FCGIProcess.start(FCGIProcess.java:68)
php.java.bridge.http.SocketChannelFactory.doBind(SocketChannelFactory.java:125)
php.java.bridge.http.FCGIConnectionFactory.runFcgi(FCGIConnectionFactory.java:88)
php.java.bridge.http.FCGIConnectionFactory$1.run(FCGIConnectionFactory.java:109)
note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.29 logs.
Apache Tomcat/6.0.29
I had the same error as yours,
the key point you are missing here is :
PHP CLI(Command Line Interface) needs to be setup to work with java-php
bridge
as you claim to have installed PHP(any means XAMPP/WAMP)
Go through the following steps :
Add PHP to PATH environment variable - Help
Confirm the configuration by Run CMD>
php-cgi -v
By the above command you will see PHP version info
Restart Tomcat
PHP/JavaBridge should start working after this.
I had the same problem. Another suggestion had been to add
-Dphp.java.bridge.php_exec=/usr/bin/php
to the command line. Instead, I modified the JAVA_OPTS export in my catalina.sh file to add it. That didn't work, but I combined it with the suggestion above and added
-Dphp.java.bridge.php_exec=/usr/bin/php-cgi
to catalina.sh. I bounced the server and connected to server/JavaBridgeTemplate621/ and got the PHP/Java Bridge settings page.
Reinstall and enable fastcgi it worked for me!
Related
I'm trying to build PHP 7.4 on Solaris sparc 10, but I'm getting this error:
d_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_inheritance.lo Zend/zend_smart_str.lo Zend/zend_cpuinfo.lo Zend/zend_execute.lo sapi/apache2handler/mod_php7.lo sapi/apache2handler/sapi_apache2.lo sapi/apache2handler/apache_config.lo sapi/apache2handler/php_functions.lo main/internal_functions.lo -lresolv -lrt -liconv -lintl -lrt -lm -lnsl -lsocket -lgcc -o libphp7.la
ld: fatal: file /usr/local/lib/libiconv.so: wrong ELF class: ELFCLASS32
ld: fatal: file processing errors. No output written to .libs/libphp7.so
*** Error code 1
make: Fatal error: Command failed for target `libphp7.la'
My configure is as follows:
./configure --disable-xmlwriter --disable-xmlreader --disable-simplexml --disable-xml --disable-dom --with-apxs2=/usr/apache2/bin/apxs --with-gd --with-zlib --disable-ipv6 --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --without-pear --with-openssl --with-mysqli --enable-bcmath --enable-ctype --enable-mbstring --with-gettext --prefix=/usr/php --without-libxml OPENSSL_CFLAGS=-I/usr/include/openssl OPENSSL_LIBS=-L/usr/local/ssl/include SQLITE_CFLAGS=-I/usr/php/include/php/ext SQLITE_LIBS=-L/usr/php/include/php/ext ZLIB_CFLAGS=-I/usr/include ZLIB_LIBS=-L/usr/include ONIG_CFLAGS=-I/usr/local/include/php/ext/mbstring ONIG_LIBS=-L/local/include/php/ext/mbstring
--with-external-pcre
--with-pcre-jit
PCRE2_LIBS=-L/app/INSTALL_FILES/php-7.4.13/ext/pcre/pcre2lib
PCRE2_CFLAGS=-I/app/INSTALL_FILES/php-7.4.13/ext/pcre/pcre2lib
SQLITE_LIBS=-L/app/INSTALL_FILES/php-7.2.5/ext/sqlite3/libsqlite
SQLITE_CFLAGS=-I/app/INSTALL_FILES/php-7.2.5/ext/sqlite3/libsqlite
Environment is set as follows:
$ env|grep LD
LDFLAGS=-L/opt/csw/lib/gcc -L/usr/local/lib -R/opt/csw/lib/gcc
LD_LIBRARY_PATH_64=/opt/csw/lib/sparcv9:/usr/local/64/lib:/usr/sfw/lib/sparcv9
LD_LIBRARY_PATH=/opt/csw/bin/sparcv9:/opt/csw/lib/sparcv9:/usr/local/include/php/ext/sqlite3/libsqlite:/opt/csw/lib:/usr/local/64/lib:/usr/sfw/lib/sparcv9:/usr/apache2.2/pcre/lib:/usr/apache2.2/apr_util/lib:/usr/apache2.2/apr/lib
LD_LIBRARY_PATH_32=/usr/local/include/php/ext/sqlite3/libsqlite:/opt/csw/lib:/usr/apache2.2/pcre/lib:/usr/apache2.2/apr_util/lib:/usr/apache2.2/apr/lib
Any help would be much appreciated, thanks in advance :)
You are building a 64-bit executable with the following environment variable set:
LD LDFLAGS=-L/opt/csw/lib/gcc -L/usr/local/lib -R/opt/csw/lib/gcc
Given this error:
ld: fatal: file /usr/local/lib/libiconv.so: wrong ELF class: ELFCLASS32
The shared object /usr/local/lib/libiconv.so is a 32-bit shared object.
You can either remove directories that have 32-bit binaries in them from your LD_* environment variables when building or running 64-bit binaries, or make sure the contents of any of those directories are all 32- or 64-bit if there's a 64-bit library in /usr/local/lib that you need.
You need to read the ENVIRONMENT VARIABLES section of the Solaris 10 ld.so.1 man page:
Environment Variables
Each environment variable can be specified with a _32 or _64
suffix. This makes the environment variable specific, respectively, to
32–bit or 64–bit processes. This environment variable overrides any
non-suffixed version of the environment variable that might be in
effect. Environment variables specified without a value, that have a
_32 or _64 suffix, effectively cancel any associated generic environment variable setting.
You're mixing a lot of LD_* environment variables with and without the _32 and _64 suffixes, and you need to clean that up and be consistent so you don't wind up mixing 32- and 64-bit executable files.
And this looks downright wrong:
ZLIB_LIBS=-L/usr/include
Libraries in /usr/include???
I am using tomcat8.5, apache2, php7.25 on ubuntu 18.04
I installed php on my computer and did other configurations and installed required libraries. In the first day it worked fine and I could run a php script properly on localhost.
But next day when I tried to run the same php file I got this error.
Type Exception Report
Message Could not connect to server. Please start it with: cd /home/dr3am/Documents/phphome/WEB-INF/cgi/amd64-linux
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
php.java.fastcgi.ConnectionException: Could not connect to server. Please start it with: cd /home/dr3am/Documents/phphome/WEB-INF/cgi/amd64-linux
REDIRECT_STATUS=200 X_JAVABRIDGE_OVERRIDE_HOSTS="/" PHP_FCGI_CHILDREN="5" PHP_FCGI_MAX_REQUESTS="500" php-cgi -b 127.0.0.1:9669
php.java.fastcgi.SocketFactory.test(SocketFactory.java:73)
php.java.fastcgi.FCGIFactory.startFCGIServer(FCGIFactory.java:99)
php.java.fastcgi.FCGIConnectionPool.createConnectionPool(FCGIConnectionPool.java:147)
php.java.servlet.ContextLoaderListener.getConnectionPool(ContextLoaderListener.java:220)
php.java.servlet.ContextLoaderListener.getConnectionPool(ContextLoaderListener.java:209)
php.java.servlet.fastcgi.FastCGIServlet.doExecute(FastCGIServlet.java:374)
php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:468)
php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:479)
php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
java.net.ConnectException: Connection refused (Connection refused)
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
java.net.Socket.connect(Socket.java:607)
java.net.Socket.connect(Socket.java:556)
java.net.Socket.<init>(Socket.java:452)
java.net.Socket.<init>(Socket.java:262)
php.java.fastcgi.SocketFactory.test(SocketFactory.java:67)
php.java.fastcgi.FCGIFactory.startFCGIServer(FCGIFactory.java:99)
php.java.fastcgi.FCGIConnectionPool.createConnectionPool(FCGIConnectionPool.java:147)
php.java.servlet.ContextLoaderListener.getConnectionPool(ContextLoaderListener.java:220)
php.java.servlet.ContextLoaderListener.getConnectionPool(ContextLoaderListener.java:209)
php.java.servlet.fastcgi.FastCGIServlet.doExecute(FastCGIServlet.java:374)
php.java.servlet.fastcgi.FastCGIServlet.execute(FastCGIServlet.java:468)
php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:479)
php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.
I didn't change any configuration file or removed any required library. But suddenly I got this error. I looked for solutions but I found nothing related to my problem.
What is the reason for this and how to solve it?
Outline:
We are trying to connect up varnish-4.1.11 to magento 1 in kubernetes using the nexcess turpentine addon, but the same error is returned each time:
Error determining Varnish version: Varnish admin socket timeout
Failed to load configurator
Application stack:
We have a kubernetes cluster running a magento 1 stack with the following containers:
php-fpm:7.2/nginx:latest
mysql:5.7
redis:latest
nfs-provisioner:latest
nginx:latest (acts as a proxy for varnish to point to)
varnish:4.1.11
kubernetes info:
Networking: cilium:v16.3
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:07:57Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Varnish config:
NFILES=131072
MEMLOCK=82000
NPROCS="unlimited"
RELOAD_VCL=1
VARNISH_VCL_CONF=/var/www/html/site/var/default.vcl
VARNISH_LISTEN_PORT=6081
VARNISH_ADMIN_LISTEN_PORT=6082
VARNISH_SECRET_FILE=/etc/varnish/secret
VARNISH_MIN_THREADS=5
VARNISH_MAX_THREADS=50
VARNISH_THREAD_TIMEOUT=120
VARNISH_STORAGE="malloc,512M"
VARNISH_TTL=120
DAEMON_OPTS="-F -a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
-f ${VARNISH_VCL_CONF} \
-T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
-t ${VARNISH_TTL} \
-S ${VARNISH_SECRET_FILE} \
-s ${VARNISH_STORAGE}" \
-p esi_syntax=0x2 \
-p cli_buffer=16384
What we've tried so far:
Downgrading to varnish-3.0.7
Pointing magento to varnish's IP directly
Running a generic varnish connection script in PHP
Notes:
Pinging the varnish pod from the nginx/fpm pod works fine
Curling to the varnish ports from the nginx/fpm pod also works fine
The generic connection script noted above works successfully when run from inside the varnish container itself, which very likely indicates a networking issue.
Running the stack locally in docker-compose works fine, which also indicates a networking issue.
I appreciate that this is a very very niche issue, but hopefully someone else has some insight into what could be going wrong.
In case anyone else encounters this or a similar issue, it was due to the linkerd service mesh we have in place not properly passing traffic.
Whilst not an ideal solution, disabling linkerd for the relevant pods resolved the issue.
i am trying to install Laravel Echo Server on Laravel 5.5 with the help of thie Article
https://medium.com/#dennissmink/laravel-echo-server-how-to-24d5778ece8b
All things is going right but when i
laravel-echo-server start
Error comes with
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
i install laravel 5.6 but still i face the same error
Thanks in advance who can guide me how can i handle this error
Seems like Redis is not installed or the Redis server is not running.
Download and install the server from https://redis.io/
And then run the service with "redis-server".
After that you can smoothly run "laravel-echo-server start"
make sure that redis listen on 127.0.0.1:6379.
look at /etc/redis/redis.conf, the line where is indicated "bind ....". make sure it's "bind 127.0.0.1" otherwise go to your laravel-echo-server.json and change databaseConfig: {redis: {port: "6379", host: "..."}}.
"..." indicating what is marked in redis.conf
Make sure you have install radis server
sudo apt install redis-server
I downloaded the Google App Engine SDK for PHP but I am having problems with the installation of the PHP interpreter. I downloaded the source code from the link given but when I try to compile php the command make terminates with this error:
/bin/bash /home/david/Google/appengine-php-master/php-src/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/jsonc/ -I/home/david/Google/appengine-php-master/php-src/ext/jsonc/ -DPHP_ATOM_INC -I/home/david/Google/appengine-php-master/php-src/include -I/home/david/Google/appengine-php-master/php-src/main -I/home/david/Google/appengine-php-master/php-src -I/home/david/Google/appengine-php-master/php-src/ext/date/lib -I/home/david/Google/appengine-php-master/php-src/ext/ereg/regex -I/libxml2 -I/home/david/Google/appengine-php-master/php-src/ext/sqlite3/libsqlite -I/home/david/Google/appengine-php-master/php-src/TSRM -I/home/david/Google/appengine-php-master/php-src/Zend -I/include -g -O2 -fvisibility=hidden -c /home/david/Google/appengine-php-master/php-src/ext/jsonc/json.c -o ext/jsonc/json.lo
In file included from ext/jsonc/json-c/json_inttypes.h:5:0,
from ext/jsonc/json-c/json_object.h:16,
from ext/jsonc/json-c/linkhash.h:16,
from ext/jsonc/json-c/json.h:22,
from /home/david/Google/appengine-php-master/php-src/ext/jsonc/json.c:34:
ext/jsonc/json-c/json_config.h:2:23: fatal error: ../config.h: No such file or directory
#include "../config.h"
^
compilation terminated.
Makefile:725: recipe for target 'ext/jsonc/json.lo' failed
make: *** [ext/jsonc/json.lo] Error 1
In fact there is no such config.h file in that directory so I can't understand how to solve this problem.
So I decided to search online the source code of PHP 5.4.19 and I compiled and installed it and everything worked. I followed all the other installation steps and everything worked.
Now if I start the server with the command
google_appengine/dev_appserver.py --php_executable_path=/usr/local/bin/php-cgi --php_gae_extension_path=/home/david/Google/appengine-php-extension-master/modules/gae_runtime_module.so my_app/
I get:
INFO 2016-03-25 15:04:19,209 sdk_update_checker.py:229] Checking for updates to the SDK.
INFO 2016-03-25 15:04:19,797 sdk_update_checker.py:257] The SDK is up to date.
INFO 2016-03-25 15:04:19,901 api_server.py:205] Starting API server at: http://localhost:51913
INFO 2016-03-25 15:04:19,907 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2016-03-25 15:04:19,909 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR 2016-03-25 15:04:21,270 php_runtime.py:348] The PHP runtime is not available
Traceback (most recent call last):
File "/home/david/Google/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 344, in new_instance
self._check_binaries(php_executable_path, gae_extension_path)
File "/home/david/Google/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 286, in _check_binaries
cls._check_gae_extension(php_executable_path, gae_extension_path, env)
File "/home/david/Google/google_appengine/google/appengine/tools/devappserver2/php_runtime.py", line 241, in _check_gae_extension
ext_stdout))
_PHPEnvironmentError: "/usr/local/bin/php-cgi -m" returned an error [-6]
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.0.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/home/david/Google/appengine-php-extension-master/remote_api.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.0.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/home/david/Google/appengine-php-extension-master/remote_api.pb.cc".)
Accordingly to the message the problem should be in the version of libprotobuf9 library. I have that library installed in my system (ubuntu 15.04) and in fact the version is 2.6.1. But by following the installation steps I installed protoc-3.0.0-beta-2-linux-x86_64 and protobuf-3.0.0-beta-2 in /usr. So, why does appengine use the wrong version of the library?
I thought about removing libprotobuf9 from my system but if I run sudo apt-get remove libprotobuf9 the list of packages that need to be removed is very big and contains things like
gnome-bluetooth gnome-calculator gnome-contacts
gnome-disk-utility gnome-font-viewer gnome-keyring gnome-mahjongg gnome-mines gnome-orca gnome-power-manager gnome-screensaver
gnome-screenshot gnome-session-bin gnome-session-canberra gnome-sudoku gnome-system-log gnome-system-monitor gnome-terminal
to me it doesn't seem a good idea to remove them. What's the solution to my problem?