Hi all, i want to change a word file ordianary text file. i used exec("antiword -f -t ".$word_file_path ." > ".$txt_file_path);to do this but not able to get this. and not getting any error in my php.ini file disable_function is also null what shall i do to convert my word file to txt file. Please help me as soon as possible. Thanks in advance.
Most of Web Hosting services disable this function due to security reason. So it may be useless, even if you are able to correct this error. Think twice. Alternative way is generating a XML file for these purpose. Am using it in my site.
if you want to test if exec function is working and get some output from it, start with something simple like: print exec("echo testing"); If that doesn't work then there's problem with PHP settings/permissions, if that works then the problem is with your command syntax or antiword program, either way you have to go step by step to locate the problem.
if (function_exists("exec")) { // Execute your code } else { // Update your php.ini - exec is disabled } PHP:
you r correct sponsorlist, the exec function is working properly how can i test what is the problem in the command -antiword -f -t ".$word_file_path ." > ".$txt_file_path. and another thing i'm working in my wamp localhost not in server. Thank you.
need install any thing for executing the antiword command? Please any one know means tell me i'm new to the commands.
I don't know anything about antiword but you need to have a right version installed(from http://www.winfield.demon.nl/ ) and in some path that can be executed by php exec(). And then figure out how to make it work in command line before trying with PHP. But you can still add print command before exec() in PHP to see if there's some response. Or google for more info http://www.google.com/search?q=antiword+php
thank you. i have tried putting print before that exec but no responds.any how its working in live the problem arises only in my localhost so no problem.