-2

Running a LAMP stack on newly-deployed CentOS 7 server. PHP 7.

I have an internal resource-intensive script that builds large PHP arrays to store data prior to parsing/writing it. It all worked fine until we migrated to the new server.

After a few minutes, the script terminates with the following error:

Error writing file '/tmp/MYxJXajd' (Errcode: 28 "No space left on device")

I checked and my /tmp partition is quite small. However I want to avoid resizing the partition just for the benefit of this one script, so I thought I would simply change the directory where this specific data is being written to a directory on the main (bigger) partition.

I used session_save_path() to change the session directory location, and can confirm this takes fine.

However, the same error still persists, so there must be some other process/setting that is writing data to the /tmp directory for the purposes of storing array data. However when doing a text search on phpinfo() output, /tmp does not appear anywhere, so am not sure what else I can change.

Any ideas?

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
R C
  • 441
  • 4
  • 10
  • 1
    It may be useful to see the script thats failing and a complete error message. Or we could just play 20 guesses – RiggsFolly Apr 01 '21 at 12:46
  • Yes I should have searched the specific error before asking a question. It's evidently a MySQL issue, have answered my own question. – R C Apr 01 '21 at 12:51

1 Answers1

0

Just quickly answering this. This specific error (28) is caused by MySQL running out of space writing temporary files, not PHP. Just need to change the tmpdir variable on mysql configuration and grant it permissions to the appropriate user.

R C
  • 441
  • 4
  • 10