Shell
I first made the following configuration in/etc/sudoers
And then restarted the next Apache server.
Within the TP frame, write to
EXEC ('/usr/bin/unoconv--server localhost--port 8100-o/usr/local/webserver/www/server/exam/public/uploads/ Resource/transform/document/201309/52419a788a553.pdf-f pdf/usr/local/webserver/www/server/exam/public/uploads/ Resource/untransform/document/201309/52419a788a553.doc ');
Run under, no effect, transcoding is not successful, the code directly out can be executed.
At the same time, I wrote the transcoding section into a shell script.
#!/bin/shturncode () {local pdf= ' echo $ | cut-d:-f1 '; local file= ' echo $ | cut-d:-f2 '; echo $pdf; echo $file; '/usr/bin/unoconv--server localhost--port 8100-o $pdf-F PDF $file '}action= ' $ "setting=" $ "case $action in turncod e) turncode "$setting" ;; *) ;; Esac
Called by exec
EXEC ("sudo./bash turncode $save _path1: $file _path1", $out, $status);
The result is still unable to transcode, who has been kindly pointed out, not very grateful!!!
Reply to discussion (solution)
command line, you are using the permissions of your account. The script can be different, completely controlled by the owner or the creator's account permissions.
Oh, it's done.
1, configure Visudo to Apache users to set permissions, specific operation
Comment out Defaults Requiretty
Add www all= (All) Nopasswd:all
2. Restart Apache Service/usr/local/webserver/apache2/bin/apachectl restart