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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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