473,703 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP5 Java Bridge Configuration

Hi--

I seem to have the PHP Java Bridge (2.0.5 built from tarball) working with
PHP 5.0.3 (also built from tarball) on my Fedora Core 1 server with Apache
2.0.50 and I'm pretty excited about it all. There are a couple of
configuration issues I've run into that are perplexing me.

First, I can't seem to change the classpath. I've added:

[java]
java.class.path ="/path/here"

to the php.ini file, just as indicated in setup documentation, phpinfo()
still reports only JavaBridge.jar in the classpath in the java section.

Without being able to add to the classpath, I can't access the Java objects
that I've built, so you can see how this could be a problem. =^)

Is there anyone that's set up the Java Bridge with PHP5 and gotten it
working? Obviously I'm tinkering in the wrong places.

It occurs to me that maybe the bridge doesn't work at all with .class files
and that in order to use these I'll need to package them in .jar files.
That's just an off-the-wall theory.

I'm a little disappointed in the bridge, although very excited about the
potential. PHP advocates have been talking about "Native Java Support" in
PHP since 2001 and even PHP5 requires some not-insignificant jumping-through
of hoops to add Java-PHP integration. Or is there something I'm totally
missing?

Thanks,
Steve

Jul 17 '05 #1
9 15404
Hi,
I've added: java.class.path ="/path/here"
to the php.ini file, just as indicated in
setup documentation
In which setup documentation have you found this? According to the
README it is java.classpath. That aside, you're right, the
documentation is currently in a horrible state, it's just that I don't
have enough time to work on it at the moment.

that I've built, so you can see how this could be
a problem. =^)


The recommended method is to create a .jar file and store it in
/usr/share/java or in %JAVA_HOME%\jre \lib\ext (on windows) for
example, please see the INSTALL and README document. -- BTW: Why do
you want to load individual class files?
Regards,
Jost Boekemeier
Jul 17 '05 #2
Hi, and thanks for responding

On 4/2/05 1:37 AM, in article
c7************* *************@p osting.google.c om, "jo******@yahoo .de"
<jo******@yahoo .de> wrote:
In which setup documentation have you found this? According to the
README it is java.classpath. That aside, you're right, the
documentation is currently in a horrible state, it's just that I don't
have enough time to work on it at the moment.
Arrgh. It looks like I was looking at the docs for the default Java Bridge
that comes with PHP4, not yours. Someone slap me.
The recommended method is to create a .jar file and store it in
/usr/share/java or in %JAVA_HOME%\jre \lib\ext (on windows) for
example, please see the INSTALL and README document. -- BTW: Why do
you want to load individual class files?


The only reason being that I'm doing development and testing and I want to
be able to edit and swap classes out with emacs and javac. I'd like to add
to the classpath because I have a group of files I'm working on that I want
to keep in their own place. I guess the jarfile is how I keep everything in
one place though?

Thanks,
Steve

Jul 17 '05 #3
On 4/2/05 1:37 AM, in article
c7************* *************@p osting.google.c om, "jo******@yahoo .de"
<jo******@yahoo .de> wrote:
The recommended method is to create a .jar file and store it in
/usr/share/java or in %JAVA_HOME%\jre \lib\ext (on windows) for
example, please see the INSTALL and README document. -- BTW: Why do
you want to load individual class files?

Does this mean that putting class files into /usr/share/java is not expected
to work? Judging by the "Uncaught thrown" error that I'm getting,
/usr/share/java is NOT in the classpath, or else .jar files are recognized
and .class files are not.

Also, classpath is reported only as

classpath=/usr/local/lib/php/extensions/no-debug-non-zts-20041030/JavaBridge
..jar

By phpinfo, so I'm clearly not doing something right.

Arrgh.
Steve

Jul 17 '05 #4
> Does this mean that putting class files into /usr/share/java is not expected
to work?
Exactly. /usr/share/java is the global repository for java archives.
Please see http://www.jpackage.org/ for details. jpackage is part of
the desktop java project supported by RedHat. -- It's really a shame
that OS projects have to correct problems that Sun cannot or is not
willing to change since more than 5 years. Please help us to stop
this classpath nonsense which causes that multiple versions of classes
are scattered all over the directory structure (belonging to different
users, have different permissions etc, etc...).

Also, classpath is reported only as
classpath=/usr/local/lib/php/extensions/no-debug-non-zts-20041030/JavaBridge
.jar


Please don't forget the double-quotes, please see
http://php-java-bridge.sourceforge.net/#ini-options for details.
Regards,
Jost Boekemeier
Jul 17 '05 #5
On 4/16/05 7:29 AM, in article
c7************* *************@p osting.google.c om, "jo******@yahoo .de"
<jo******@yahoo .de> wrote:
Exactly. /usr/share/java is the global repository for java archives.
Please see http://www.jpackage.org/ for details. jpackage is part of
the desktop java project supported by RedHat. -- It's really a shame
that OS projects have to correct problems that Sun cannot or is not
willing to change since more than 5 years. Please help us to stop
this classpath nonsense which causes that multiple versions of classes
are scattered all over the directory structure (belonging to different
users, have different permissions etc, etc...).
Okaaaay.... What can I do to "stop the nonsense"? I'm not certain what
you're suggesting.

Please don't forget the double-quotes, please see
http://php-java-bridge.sourceforge.net/#ini-options for details.


OK, that solved my problem, and I feel kinda foolish. Thanks!

Is there a PHP/Java Bridge users forum somewhere? I suspect that I'm going
to have a lot more questions and fun with this as I go along. Neither
comp.lang.php nor any of the java newsgroups seem like the ideal place to
discuss.

Thanks,
Steve

Jul 17 '05 #6
> > this classpath nonsense which causes that multiple versions of classes
are scattered all over the directory structure (belonging to different
users, have different permissions etc, etc...).
Okaaaay.... What can I do to "stop the nonsense"? I'm not certain what
you're suggesting.


Please create a .jar file from your classes and store it as
/usr/share/java/myProject/myLibrary-version.jar or as `php-config
--extension-dir`/lib/myProject/myLibrary-version.jar. After that you
can reference your library with:

java_set_librar y_path("myProje ct/myLibrary-version.jar;<ot her
libraries...>") ;

at run-time.
(In versions prior to 2.0.6 it was necessary to use the full path i.e.
java_set_librar y_path("/usr/share/myProject/myLibrary-version.jar");)

That way you can specify exactly which library version you want and
you don't have to re-start the bridge if you want to add additional
libraries.

Please don't forget the double-quotes, please see
http://php-java-bridge.sourceforge.net/#ini-options for details.


OK, that solved my problem, and I feel kinda foolish. Thanks!


Yeah. The documentation is still evolving. Sorry for that.

Is there a PHP/Java Bridge users forum somewhere?


Either http://sourceforge.net/forum/?group_id=117793 or our mailing
list:
-> ph************* ******@lists.so urceforge.net
To subscribe:
-> http://lists.sourceforge.net/lists/l...a-bridge-users

Archive:
-> http://sourceforge.net/mailarchive/f...a-bridge-users
Regards,
Jost Boekemeier
Jul 17 '05 #7
> bumeshraiwrote:
when I run a php page for writting out a file, I log the following error:
java.lang.Class NotFoundExcepti on: Class java.io.FileOut putStream('work book.xls') not found at php.java.bridge .DynamicClassLo ader.loadClass( DynamicClassLoa der.java:358) at php.java.bridge .JavaBridgeClas sLoader.forName (JavaBridgeClas sLoader.java:58 ) at php.java.bridge .JavaBridge.Cre ateObject(JavaB ridge.java:450)
at php.java.bridge .Request.handle Requests(Reques t.java:197)
at php.java.bridge .JavaBridge.run (JavaBridge.jav a:142)
at php.java.bridge .ThreadPool$Del egate.run(Threa dPool.java:20)

Did you require the *.jar that contians the class you were using?

Aug 31 '05 #8
Hello!
java.lang.Class NotFoundExcepti on: Class

java.io.FileOut putStream('work book.xls') not found
Did you require the *.jar that contians the class you were using?


I do not think that a class called
`java.io.FileOu tputStream('wor kbook.xls')' exists, even though it is a
valid class name. 8)

You probably want something like java("java.io.F ileOutputStream ",
'workbook.xls') ; instead of
new java("java.io.F ileOutputStream ('workbook.xls' )");

:)

Sep 5 '05 #9
pawanghildiyal
1 New Member
Hi Steven,
The problem is with class path.
u have to set class path as

java.classpath=/path/java/files

I'm sure that it will work for u.I faced same kind of problem and It was working fine for me

regards,
Pawan




Hi--

I seem to have the PHP Java Bridge (2.0.5 built from tarball) working with
PHP 5.0.3 (also built from tarball) on my Fedora Core 1 server with Apache
2.0.50 and I'm pretty excited about it all. There are a couple of
configuration issues I've run into that are perplexing me.

First, I can't seem to change the classpath. I've added:

[java]
java.class.path ="/path/here"

to the php.ini file, just as indicated in setup documentation, phpinfo()
still reports only JavaBridge.jar in the classpath in the java section.

Without being able to add to the classpath, I can't access the Java objects
that I've built, so you can see how this could be a problem. =^)

Is there anyone that's set up the Java Bridge with PHP5 and gotten it
working? Obviously I'm tinkering in the wrong places.

It occurs to me that maybe the bridge doesn't work at all with .class files
and that in order to use these I'll need to package them in .jar files.
That's just an off-the-wall theory.

I'm a little disappointed in the bridge, although very excited about the
potential. PHP advocates have been talking about "Native Java Support" in
PHP since 2001 and even PHP5 requires some not-insignificant jumping-through
of hoops to add Java-PHP integration. Or is there something I'm totally
missing?

Thanks,


Steve
May 5 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6700
by: OmyGOD | last post by:
I am trying to bridge Java and PHP. We know there's php_java.dll in PHP4, but this module is not bundled in PHP5 packages. And there's no way to download this module. I tried to use php_java.dll in PHP4 package as a extension in PHP5, and it doesn't work. Does anybody knows how to bridge Java and PHP5?
1
2249
by: Jerry | last post by:
My configuration is as follows. I have a Linux MySQL server database on one box and I want to connect to it from a local Windows XP laptop. My application was developed using SunOneStudio. I have registered the DSN and tested the database connection via ODBC in Windows XP. It apparently connects from XP to the server. I have compiled two base classes and have a tester class which
11
9255
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
2
2533
by: zhong.zx | last post by:
When I struggling to compile the php-java bridge on the following step on FreeBSD 4.11, I met error and cannot go through it: CMD: phpize && ./configure --with-java=/usr/java/jdk1.5.0 && make && make install ERROR: ----------------------------------------- configure: error: host_alias is not set. Make sure to run config.guess
1
2028
by: Rithish | last post by:
Has anyone sucessfully compiled PHP5 with JAVA support? Response is appreciated. Regards, Rithish.
4
3127
pbmods
by: pbmods | last post by:
Heya. I just installed PHP-Java-Bridge on my system, but I'm having a hard time getting it to stop crashing Apache. When I activate the 'Java.so' module in php.ini, I get the following error in my Apache logfile: Attempting to load any page on my webserver results in a segfault. Whee.
1
2398
pbmods
by: pbmods | last post by:
Heya. I just installed PHP-Java-Bridge on my system, but I'm having a hard time getting it to stop crashing Apache. When I activate the 'Java.so' module in php.ini, I get the following error in my Apache logfile: Attempting to load any page on my webserver results in a segfault. Whee.
0
2020
by: cosmicxdust | last post by:
I am using Wamp5 v1.7.3 (PHP 5.2.4, Apache/2.2.4). When installing php-java-bridge-3.2.1_j2ee, I copy php_java.dll from PHP/Java Bridge to D:\php\ext. When I start all services, I got this Apache log error. PHP Warning: PHP Startup: java: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=1 PHP compiled with module API=20060613, debug=0, thread-safety=1 These options need to match in...
0
1275
by: srinivasmsr | last post by:
please any body help me, how to install the php java bridge and configuration. i had php4.3 version.
0
8741
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8658
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9096
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7842
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6583
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5919
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2419
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.