S
S
Sam672019-08-13 19:26:27
linux
Sam67, 2019-08-13 19:26:27

How to run linux terminal command via php?

Hello!
The problem is this. On my VPS there is a file that should be converted using the program with the arguments passed to it.
By accessing the server through the terminal in Linux and executing the command, the converted file is created in the destination folder. The command is below.
biom convert -i web/bogdan.kirukhin67.example.com/public_html/files/otu_table_filtered.biom -o web/bogdan.kirukhin67.example.com/public_html/files/file.txt --to-tsv --header-key taxonomy
Actually, I tried to write in PHP the same thing of the following type;
exec("biom convert -i web/bogdan.kirukhin67.example.com/public_html/files/otu_table_filtered.biom -o web/bogdan.kirukhin67.example.com/public_html/files/file.txt --to-tsv -- header-key taxonomy")
When called via PHP, nothing happens. What could be the problem?
Maybe this is due to the fact that when I log in through the terminal, I log in with admin rights, and in the case of a call via PHP, there is no authorization ...
In general, please tell me how to make everything work. Thanks in advance!:)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2019-08-13
@Sam67

For starters - full, not relative paths to files. And the biom program is also desirable.
Then you can look at the exec documentation and find that it returns what was printed to the terminal - errors are most likely there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question