shell_exec

Alles, was PHP betrifft, kann hier besprochen werden.

shell_exec

Postby axelbehappy » 27. December 2023 18:40

Hallo liebes Forum,

ich möchte aus PHP eine Datei mit tesseract(ocr open source) in ein indiziiertes PDF umwandeln.
Dazu rufe ich in einen PHP Script

$exec_result=shell_exec($exec);

Ein
echo "<br>EXEC TESSERACT RESULT : ".$exec_result;
ergibt
EXEC TESSERACT RESULT :

Im error_log von XAMPP steht:
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

Das war jetzt bisher der WEg in Richtung, tesseract bekommt eines sudoers Eintrag und dann kann ich das mit sudo wie oben machen. Das fühlt sich jedoch schlecht, an, weil ich einem Script dann sudo öffne,

Was ist der beste Weg das zu handeln?

Macht es Sinn tsseract zu der Gruppe "daemon"(wird von XAMPP benutzt hinzu zu fügen?

Bin für jeden Hinweis/Quelle/Tip dankbar.

Weihnachtliche Grüße aus Hamburg,
Axel



auf. $exec ist "sudo /usr/local/bin/tesseract /Applications/XAMPP/htdocs/captence/ocr_process/1.tiff out l deu PDF"
Ich lasse
Ich
axelbehappy
 
Posts: 1
Joined: 27. December 2023 18:21
XAMPP version: 8.2.4-0
Operating System: MAcos Montere<

Return to PHP

Who is online

Users browsing this forum: No registered users and 57 guests