poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MSB <markbrd...@tiscali.co.uk>
Subject Re: Can't execute Java from PHP
Date Sun, 03 Jan 2010 08:55:12 GMT

Hello Dave,

Like David, I am not an expert with PHP - in fact, I have never used it
before - but I wanted to ask whether you have been able to isolate the
problem to just the POI libraries? What happens if, for instance, you create
a very simple class that counts from one to one hundred and writes the
results to a file, then try to run that as you have the POI based code? It
would be worth using Netbeans to create a distribution just as you already
have done just to see if this is somehow creating problems as well IMO.
Aside form that, I cannot offer any help at all I am afreaid.

Yours

Mark B


Dave Coventry-4 wrote:
> 
> Dave,
> 
> I appreciate the input.
> 
> The command  'java -jar /home/dave/web/drupal/java/dist/emp.jar' works
> fine on the command line.
> 
> I am using the Java HSSF code to upload spreadsheets into a database via
> PHP.
> 
> Has anyone attempted anything similar?
> 
> Other external functions are called from the same script without error.
> 
> 2010/1/3 David Fisher <dfisher@jmlafferty.com>:
>> Check your java classpath. Is poi properly included? I think that this is
>> the true issue guessing from your example.
>>
>> Of course, I am NOT a php person, but I guess
>>
>> system("set");
>>
>> or
>>
>> system("setenv");
>>
>> Regards,
>> Dave
>>
>> On Jan 2, 2010, at 9:49 PM, Dave Coventry wrote:
>>
>>> I can't run my Java HSSF app from PHP.
>>>
>>> I've asked on PHP forums but everybody seems as perplexed as I.
>>>
>>> Perhaps someone on here has had similar problems and either knows the
>>> answer or can suggest steps to take to debug it.
>>>
>>> The following line in my PHP script fails. nothing prints out, it just
>>> returns FALSE.
>>> ~~~~~~~~~ 8< ~~~~~~~~~~~~
>>> system('java -jar /home/dave/web/drupal/java/dist/emp.jar');
>>> ~~~~~~~~~ 8< ~~~~~~~~~~~~
>>>
>>> However, this works: (It prints out the help info normally associated
>>> with incorrect parameters passed to Java.)
>>> ~~~~~~~~~ 8< ~~~~~~~~~~~~
>>> system('java -jar');
>>> ~~~~~~~~~ 8< ~~~~~~~~~~~~
>>>
>>>
>>>
>>> This also works:
>>> ~~~~~~~~~ 8< ~~~~~~~~~~~~
>>> system("ls -l /home/dave/web/drupal/java/dist/emp.jar");
>>> ~~~~~~~~~ 8< ~~~~~~~~~~~~
>>>
>>> It prints out a listing of /home/dave/web/drupal/java/dist/emp.jar
>>> including permissions.
>>>
>>> Thanks,
>>>
>>> Dave C.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: user-help@poi.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Can%27t-execute-Java-from-PHP-tp26999305p26999905.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message