Issues on Hostinger Shared Hosting – Template Customization Errors

Version v5.11.49-C172

Environment Shared Hosting

Bug

Hi,

I’m using Invoice Ninja, installed on a subdomain hosted on Hostinger’s Business Web Hosting plan.
For example: http://office.mysite.com/

/home/uxxxxxxxxx/domains/mysite.com/public_html/office

I’m using Flutter, but I’ve also tested React. Here are the issues I’m encountering with each:

Flutter: When I try to customize a template, I get the following error:

Error: please check that Invoice Ninja v5 is installed on the server
URL: https://office.mysite.com/api/v1/preview?
Response: Forbidden
Headers: {alt-svc: h3=“:443”; ma=86400, content-encoding: br, content-type: text/plain, date: Wed, 05 Mar 2025 10:03:53 GMT, server: hcdn, vary: Accept-Encoding, x-hcdn-request-id: 15d9bc03445155588007dbdc4d06a8dd-int-edge2}}

React: When I try to customize a template, Invoice Ninja logs out automatically and doesn’t save the changes.

My .env configuration is as follows:

APP_URL=“https://office.loopstudio.pt
REACT_URL=https://office.loopstudio.pt

options - snappdf / phantom / hosted_ninja

PDF_GENERATOR=hosted_ninja

(Hostinger does not allow snappdf - I think - , so I’m using hosted_ninja).

My .htaccess file is configured as follows:

SecFilterEngine Off SecFilterScanPOST Off RewriteEngine On RewriteRule "^.env" - [F,L] RewriteRule "^storage" - [F,L] RewriteRule ^(.well-known)($|/) - [L] RewriteRule ^(.*)$ public/$1 [L]

I have also checked the write permissions for the storage folder and subfolders, setting them to 775, but this didn’t resolve the issue.

Does anyone have any idea how to solve this?

Logs

[2025-03-05 10:25:06] production.ERROR: fopen(/home/uXXXXXXXXX/domains/mysite.com/public_html/office/storage/framework/cache/data/ac/ac/acace746aba0910583cdd0d39bf52f9740425b1c): Failed to open stream: No such file or directory {“exception”:"[object] (ErrorException(code: 0): fopen(/home/uXXXXXXXXX/domains/mysite.com/public_html/office/storage/framework/cache/data/ac/ac/acace746aba0910583cdd0d39bf52f9740425b1c): Failed to open stream: No such file or directory at /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php:69)

[stacktrace]

#0 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(256): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()

#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()

#2 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php(69): fopen()

#3 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Filesystem/LockableFile.php(42): Illuminate\Filesystem\LockableFile->createResource()

#4 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(108): Illuminate\Filesystem\LockableFile->__construct()

#5 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Cache/FileLock.php(14): Illuminate\Cache\FileStore->add()

#6 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Cache/Lock.php(91): Illuminate\Cache\FileLock->acquire()

#7 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheEventMutex.php(66): Illuminate\Cache\Lock->get()

#8 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ManagesAttributes.php(152): Illuminate\Console\Scheduling\CacheEventMutex->exists()

#9 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Console\Scheduling\Event->Illuminate\Console\Scheduling\{closure}()

#10 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

#11 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(83): Illuminate\Container\Util::unwrapIfClosure()

#12 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()

#13 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/Container.php(696): Illuminate\Container\BoundMethod::call()

#14 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php(334): Illuminate\Container\Container->call()

#15 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(124): Illuminate\Console\Scheduling\Event->filtersPass()

#16 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Console\Scheduling\ScheduleRunCommand->handle()

#17 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

#18 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(95): Illuminate\Container\Util::unwrapIfClosure()

#19 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()

#20 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Container/Container.php(696): Illuminate\Container\BoundMethod::call()

#21 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Console/Command.php(213): Illuminate\Container\Container->call()

#22 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/symfony/console/Command/Command.php(279): Illuminate\Console\Command->execute()

#23 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Symfony\Component\Console\Command\Command->run()

#24 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/symfony/console/Application.php(1094): Illuminate\Console\Command->run()

#25 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/symfony/console/Application.php(342): Symfony\Component\Console\Application->doRunCommand()

#26 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/symfony/console/Application.php(193): Symfony\Component\Console\Application->doRun()

#27 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\Component\Console\Application->run()

#28 /home/uXXXXXXXXX/domains/mysite.com/public_html/office/artisan(35): Illuminate\Foundation\Console\Kernel->handle()

#29 {main}

"}

Hi,

I believe I’ve been helping you on Reddit, thanks for moving here…

As a next step I suggest setting up a phpinfo file to confirm if mod_security is enabled/disabled.