How to solve Laravel Error Messsage rmdir(/tmp/php-xdg-runtime-dir-fallback-root): Directory not empty using PHP Artisan Tinker in Laravel

Posted on

This is an article written for showing on how to solve an error message which is triggered in the development of a Laravel web-based application project. It is shown as follows :

root@hostname:/var/www/html/laravel# php artisan tinker

[ErrorException]
rmdir(/tmp/php-xdg-runtime-dir-fallback-root): Directory not empty

root@hostname:/var/www/html/laravel#

As shown in the above output command of the command ‘php artisan tinker’, it is generating an error message :

rmdir(/tmp/php-xdg-runtime-dir-fallback-root): Directory not empty

Access the folder specified in the above error message shown below :

root@hostname:/var/www/html# cd /tmp/
root@hostname:/tmp# ls -al
total 268
drwxrwxrwt 17 root     root     196608 Nov  8 11:12 .
drwxr-xr-x 27 root     root       4096 Des  6  2016 ..
-rw-------  1 user     user         0 Nov  7 07:33 config-err-XGsW34:
drwxrwxrwt  2 root     root       4096 Nov  7 07:32 .font-unix
drwxr-xr-x  2 user     user       4096 Nov  7 14:10 hsperfdata_user
drwxrwxrwt  2 root     root       4096 Nov  7 07:33 .ICE-unix
drwxrwxr-x  2 user     user       4096 Nov  7 14:10 jna-99043865
drwx------  2 user    user        4096 Nov  7 14:51 kde-userxrmrRW
srwxrwxrwx  1 mongodb  nogroup       0 Nov  7 07:33 mongodb-27017.sock
drwx------  2 user     user      4096 Nov  8 09:40 mozilla_user0
-rw-rw-r--  1 postgres postgres      0 Nov  7 20:54 employee.sql
drwx------  3 root     root       4096 Nov  8 10:07 php-xdg-runtime-dir-fallback-root
srwxrwx---  1 monetdb  monetdb       0 Nov  7 07:32 .s.merovingian.50000
srwxrwxrwx  1 monetdb  monetdb       0 Nov  7 07:32 .s.monetdb.50000
-rw-r--r--  1 root     root         15 Nov  8 11:08 Syslog_syslog.idx
drwx------  3 root     root       4096 Nov  7 07:32 systemd-private-f90dd5c8ac3642579c65049545a372a6-colord.service-ZxrH7O
drwx------  3 root     root       4096 Nov  7 07:32 systemd-private-f90dd5c8ac3642579c65049545a372a6-redis-server.service-FpRQ64
drwx------  3 root     root       4096 Nov  7 07:33 systemd-private-f90dd5c8ac3642579c65049545a372a6-rtkit-daemon.service-1EjCCT
drwxrwxrwt  2 root     root       4096 Nov  7 07:32 .Test-unix
drwx------  2 user     user       4096 Nov  8 08:40 tracker-extract-files.1000
drwx------  2 user     user       4096 Nov  7 09:18 .vbox-user-ipc
drwxrwxrwt  2 root     root       4096 Nov  7 07:33 .X11-unix
-rw-------  1 user     user        108 Nov  7 14:49 xauth-1000-_1
drwxrwxrwt  2 root     root       4096 Nov  7 07:32 .XIM-unix
root@hostname:/tmp# 

Checking the content, it is actually nothing inside the folder.  It is shown as follows :

root@hostname:/var/www/html# cd /tmp/
root@hostname:/tmp# cd php-xdg-runtime-dir-fallback-root/
root@hostname:/tmp/php-xdg-runtime-dir-fallback-root# ls -al 
total 68
drwxrwxr-x   2 user user  4096 Oct 27  2014 .
drwxrwxr-x 129 user user 61440 Nov 11 14:37 ..
root@hostname:/tmp/php-xdg-runtime-dir-fallback-root# 

The command which is exactly used in order to simulate or to display the application in a certain port must be terminate and reactivate. So, in order to do it, just do the following step :

1. Stop the service by executing the following command in the already running service by typing Crtl+C as shown below where it is shown in the following output :

user@hostname:/var/www/html/laravel$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
^C
user@hostname:/var/www/html/laravel$ 
  1. Start again the service by executing the same command :
php artisan serve

Below is the command execution in real situation :

user@hostname:/var/www/html/laravel$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>

By doing the above command, it doesn’t need to remove the folder, it will be removed automatically. But since the error is actually pointed out for removing the directory if the above steps doesn’t worked, just execute command to remove the directory.

One thought on “How to solve Laravel Error Messsage rmdir(/tmp/php-xdg-runtime-dir-fallback-root): Directory not empty using PHP Artisan Tinker in Laravel

Leave a Reply