Reply to Re: Problem to launch a program with system()

Your name:

Reply:


Posted by Colin McKinnon on 11/19/17 11:46

sylsau wrote:

> Hello,
>
> I wrote a JAVA program which uses the JAVA API JDOM 1.0 (of this site
> www.jdom.org)
> I put the archive jdom.jar in the directory /usr/share/java/jdom.jar
> and I added this path in the CLASSPATH variable.
> The program runs normally when I launch it in a unix shell.
>
> Now, I want to launch this JAVA program in a PHP program with system()
> function for example. I have an Apache server with PHP 4 who runs. The
> variable safe_mode of PHP is at off. So, the program PHP can launch
> executable program.
>

<snip>
> On my computer, Apache runs on the user www-data. And i tried to
> execute my program JAVA on this user and it runs normally. Besides, the
> CLASSPATH of the user www-data contain the path to jdom.jar
>
> This is the error message (contained in the file test.txt) after the
> execution of the PHP program :
>
> test
> Step 1
> FAILED
> java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
> at Test.main(Test.java:51)
>

So check the CLASSPATH environment variable from within PHP. If its not
there. set it before running your java prog.

C.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация