Upgrade from 4.5.50 to 5.12.8 within invoice ninja

You may want to check the permissions on the server

Hi, I have checked every where I know. I can save or create content everywhere except, in the settings. There is no error code logged. When I click on save, the browser goes blank, then i have to refresh, and the data is not saved.
Is there a place to create a help ticket?
Thanks

This is the place to ask for help with selfhost support

Are there any errors in the browser console or in storage/logs?

The only information in storage log is:
laravel.log ( ASCII text )
[2025-07-28 23:30:02] production.INFO: updating currencies
[2025-07-29 06:20:02] production.INFO: Performing Autobilling 2025-07-29 06:20:02

Its only in settings that content won’t save. I check all permissions. Any other suggestions?

Are you still seeing the permissions error in the mobile app?

Yes, below is the error I get on mobile app:

Error: please check that Invoice Ninja v5 is installed on the server

URL: http://mirna.casalindacleaningservices.com/api/v1/companies/VolejRejNm?

Response: <br />
<b>Warning</b>:  file_get_contents(): Unable to create temporary file, Check permissions in temporary files directory. in <b>/home/mirna/public_html/mirna.casalindacleaningservices.com/vendor/s

Headers: {connection: Upgrade, date: Tue, 29 Jul 2025 13:17:04 GMT, vary: Accept-Encoding, content-encoding: gzip, content-length: 263, x-robots-tag: noindex, nofollow, p3p: policyref="/w3c/p3p.xml", CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT", content-type: text/html; charset=UTF-8, server: Apache, upgrade: h2,h2c}}

I’m not sure, here’s what ChatGPT suggests in case it’s helpful

That warning means PHP is trying to create a scratch file (for file_get_contents(), cURL, PDF generation, etc.) but the temp directory it thinks it should use either doesn’t exist, isn’t writable by the PHP‑FPM/CGI user, or is outside an open_basedir jail. The fix is to point PHP at a writable folder and make sure the web‑server user can write there.


1 ️⃣ Find out which temp folder PHP is using

php -r 'echo sys_get_temp_dir(), PHP_EOL;'

If that prints something like /tmp/systemd-private‑xxxx/tmp or even an empty string, PHP is relying on a folder that may not exist under your shared‑hosting jail.


2 ️⃣ Create a safe temp folder inside your account

mkdir -p /home/mirna/tmp
chmod 1777 /home/mirna/tmp   # drwxrwxrwt, same as /tmp

(1777 gives “sticky‑bit” write access for every process but stops one user deleting another’s files.)


3 ️⃣ Tell PHP to use it

If you have a per‑domain php.ini or the cPanel “MultiPHP INI Editor”

; /home/mirna/public_html/php.ini
sys_temp_dir   = "/home/mirna/tmp"
upload_tmp_dir = "/home/mirna/tmp"

Or via an .htaccess drop‑in

# .htaccess in public_html
php_value sys_temp_dir   "/home/mirna/tmp"
php_value upload_tmp_dir "/home/mirna/tmp"

After saving, restart PHP‑FPM / kill .php-fpm processes from cPanel so the new settings are read.


4 ️⃣ Check open_basedir

Some shared hosts lock PHP into open_basedir=/home/mirna/:/tmp/.
If you set a custom temp folder, make sure that folder is inside the allowed paths or extend the rule.


5 ️⃣ Clear caches & retest

php artisan optimize:clear

Then try the action that was failing. If the warning disappears, you’re done.


Why this works

file_get_contents() (and lower‑level stream wrappers) call tmpfile() under the hood. When PHP can’t open a file in the temp dir it shows exactly the message you saw. The fix is always permission + correct path; several PHP users solved it simply by setting sys_temp_dir to a folder they own (Stack Overflow), and Stack Overflow answers explain that the error has nothing to do with FTP/Guzzle/Invoice Ninja itself but with PHP’s temp directory rights (Stack Overflow).


Quick checklist

Item Command / setting Expected
Temp dir exists & writable ls -ld /home/mirna/tmp drwxrwxrwt
PHP uses that dir `php -i grep sys_temp_dir` /home/mirna/tmp
Enough disk quota df -h / cPanel “Disk Usage” Free space > 0
Not cleaned away by cron crontab -l No aggressive /tmp cleanup

If everything above is correct and the warning persists, double‑check SELinux/AppArmor rules or open a ticket with the host—they sometimes mount /tmp as noexec,nosuid,nodev, which can also block temp‑file creation.


Bottom line: point PHP at a folder you control, give it 1777 perms, and restart PHP. That eliminates the temp‑file warning in Invoice Ninja 99 % of the time.

Ok, give me some time to follow up with these suggestions. thanks