Wrong output directory

Hi I am currently using libreoffice to convert/get-text from docx (via php exec func). The conversion is a success but the output directory is up level (not the same as directory of file to be converted)

  1. file to convert directory = /usr/share/nginx/www/app/public/uploads
  2. pdf output file directory = /usr/share/nginx/www/app/public (up-level?)
  3. libreoffice command - "/usr/bin/libreoffice --headless --invisible -convert-to pdf —outdir " . $uploadPath . $fileName
  4. where in upload path = ‘public/uploads’
  5. where in fileName = ‘uploaded by users’

Thanks in advance!

Please use the “what is your question?” field for a question. Thanks!

Does terminating the path with a forward slash (e.g., instead of /usr/share/nginx/www/app/public use /usr/share/nginx/www/app/public/) make any difference?