Jump to content

Linux Command In Php Shell_Exec


bugcoder

Recommended Posts

Hello experts,

 

I am trying to run linux command for converting xls to csv file using php shell_exec but I am getting nothing in $output variable in following code. Paths etc are fine.

 

		

$filePath = 'files/temp_file_location/temp_name.xls';
$csvOutput = 'files/temp_file_location/output.csv';
chdir('files/temp_file_location' );
$output = shell_exec("ssconvert --export-type=Gnumeric_stf:stf_csv $filePath $csvOutput");
echo $output;

 

My above linux command is working perfectly fine in terminal window.

 

 

Will be greatful for any kind of help.

Link to comment
https://forums.phpfreaks.com/topic/269444-linux-command-in-php-shell_exec/
Share on other sites

well it was not outputting anything and neigther it was converting to csv file

 

now I am using catDoc following command but similar thing is happening. no output and no csv file. :confused:

 

exec("xls2csv -x temp_name.xls -s cp1252 -d 8859-1 > output.csv");

 

whereas it works fine in terminal window.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.