poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Coventry <dgcoven...@gmail.com>
Subject Re: Can't execute Java from PHP
Date Sun, 03 Jan 2010 06:29:38 GMT
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


Mime
View raw message