Error write failed: No space left on device

Asked

Viewed 2,752 times

4

By reinstalling the Apache and PHP server on my machine I am getting this error:

Warning: Unknown(): write failed: No space left on device (28) in Unknown on line 0

And if I try to run any session script, apart from this error, I get the following error:

Warning: Unknown(): Failed to write Session data (files). Please Verify that the Current Setting of Session.save_path is correct (/tmp) in Unknown on line 0

  • which distro and which command you are using to install?

  • @AdirKuhn http://answall.com/help/self-answer

  • Before giving a negative vote, understand the community model, read: http://answall.com/help/self-answer and http://blog.stackoverflow.com/2012/05/encyclopedia-stack-exchange and if you have any other reason to downvote please justify.

1 answer

5


This problem usually occurs for reasons such as:

  • The directory configured (in the case /tmp) is not allowed to write.
  • The directory does not allow access from the current user (the server may have access from the main user, but the directory only has access from root).
  • It could be a directory that doesn’t exist.

The directory /tmp is just an example, see another problem situation:

Warning: Unknown: Failed to write Session data (files). Please Verify that the Current Setting of Session.save_path is correct (/opt/lampp/tmp/Session) in Unknown on line 0

In this case the server has been installed lampp on a like-Unix machine and it is likely that the folder /opt/lampp/tmp/session is not accessible (for one of the reasons described above).

In case the problem is likely to also return this error:

Warning: Unknown(): Failed to write Session data (files).

Possible solutions:

  1. If the directory does not exist we must edit the file php.ini and configure to a valid directory: Search the archive php.ini is online and change it:

    session.save_path = /home/user/tmp;
    

    If it is a Windows server/machine it would be something like:

    session.save_path = c:/wamp/tmp;
    
  2. If you have made the modification php.ini and even then the problem occurs, it may be that you are in a "virtual server", therefore change has to be in such server.

  3. If you are sure that you are not a virtual server or that you have changed the right file, then that is why you need to restart the server (you do not need to restart the whole machine):

    If you are Apache, in the terminal use the command:

    apache2 restart or with SU use sudo apache2 restart

  4. If you have restarted (even the machine), the problem may be in the folder permissions. To change permissions, use the following command:

    chmod 1777 /tmp

Note: In like-Unix systems it is not necessary to allow the folder access that will be the session for all user (operating system user), only the user that the service is spinning.

Another solution is to configure using (in case the problem is with session_start) the session_save_path:

session_save_path('/home/user/tmp');

Now if for some reason you are using a hosting service and you do not have access to php.ini and the session_save_path is disabled there is only one solution, seek technical support from the company that is providing you the service, through ticket, telephone or email (in some cases chat).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.