Jump to content

php exec() not working -- please help


louis_coetzee

Recommended Posts

Hi,

 

I have a java file that needs to be executed from my php script, the command I have in it works perfectly when I execute directly in the command line, but when I execute it from php it returns this: array(0) { }

 

I have tested that the exec works by using antiword, which does return results as expected, but its not working for the code below.

But I would much rather use apache tika.

 

Also your thoughts on whether this is good practice please. I am using this to extract text from CV's and store that in the db to be able to search through. I need to extract from: pdf, doc, rtf and docx. this is the only tool I have found that can handle them all.

 

your help on the exec problem and any suggestions will be much appreciated.

 

<?php
   exec('java -jar /etc/tika-app-1.0.jar -t /var/www/html/cvdatabase/400001.doc', $output);
   var_dump($output);
?>

Link to comment
Share on other sites

what I have done now is to move the tika jar file to the root dir of my website, it now returns something, but its an error:

 

array(3) { [0]=> string(72) "OpenJDK Client VM warning: Attempt to allocate stack guard pages failed." [1]=> string(42) "Error occurred during initialization of VM" [2]=> string(45) "Could not reserve enough space for code cache" }

 

please note, this does work correctly in my command line

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.