Any free or cheaper alternative to ConvertAPI for LibreOffice document conversion on shared hosting (Hostinger, PHP)?
Posted by Guts-Akira-Hanamichi@reddit | learnprogramming | View on Reddit | 1 comments
Hi, I’m working on a PHP project hosted on Hostinger (shared hosting), and I need to convert documents ( DOCX to PDF) using LibreOffice or something similar. Now, the problem is I can’t install LirreOffice on shared hosting (no root access) Services like ConvertAPI are too expensive for my use case
Using a VPS is also too costly for me right now
From what I understand, tools like LibreOffice Online require a server setup and aren’t really suitable for shared hosting and solutions like Gotenberg also need VPS/Docker
So my questions:
Is there any free or cheaper API alternative for document conversion?
Are there any workarounds using PHP (without needing VPS/root access)?
Has anyone successfully done this on Hostinger shared hosting?
I’m okay with using any Open-source tools,External APIs (as long as they’re affordable or have a decent free tier) and any creative workaround
WelcomeEarly6408@reddit
If you need DOCX to PDF on shared hosting without shell access, you have a few practical paths:**Option 1: CloudConvert API** — offers 25 free conversions per day. For a low-volume project, this is often enough and you can grab the result with a simple curl request.**Option 2: Pure PHP with PHPWord + TCPDF / mPDF.** You can load a DOCX with PHPWord and write it to PDF. Caveat: complex formatting (advanced tables, images, styles) often breaks. This works best if your DOCX files are simple.**Option 3: Re-architect the flow.** If you are generating the DOCX, consider generating HTML instead and converting that with DomPDF or mPDF. HTML to PDF is far more reliable on shared hosting than DOCX to PDF.Avoid trying to run LibreOffice or Gotenberg on Hostinger shared hosting — it is technically impossible without root/VPS access.I would try CloudConvert first if volume is low, and switch to Option 3 if you need unlimited conversions.