-1

using

xls2csv -x /usr/share/nginx/html/price_list_EN.xls -s cp1252 -d 8859-1 > /usr/share/nginx/html/price_list_EN.csv

in linux commandline it works and exports it correctly, but if I use it on php

$transf2 = "xls2csv -x /usr/share/nginx/html/price_list_EN.xls -s cp1252 -d 8859-1 > /usr/share/nginx/html/price_list_EN.csv";

exec($transf2);

a file named price_list_EN.csv appears but it remains empty...

1 Answers1

0

Try to execute your command like this from shell

su -s /bin/bash -c "xls2csv -x /usr/share/nginx/html/price_list_EN.xls -s cp1252 -d 8859-1 > /usr/share/nginx/html/price_list_EN.csv" www-data(your webserver user name)

then you debug the error

Naga Raju
  • 83
  • 4