# Openlitespeed

**URL:** <https://forums.managingwp.io/t/openlitespeed/185>\
**Category:** Web Servers\
**Created:** [December 13, 2023, 3:35pm UTC](https://forums.managingwp.io/t/openlitespeed/185 "2023-12-13T15:35:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jtrask](https://forums.managingwp.io/user_avatar/forums.managingwp.io/jtrask/32/3_2.png) [@jtrask](https://forums.managingwp.io/u/jtrask)\
**Post date:** [December 13, 2023, 3:35pm UTC](https://forums.managingwp.io/t/openlitespeed/185/1 "2023-12-13T15:35:42Z")

</div>

# Common Issues

## PHP Session Filling up /tmp

When installing openlitespeed, you might run into an issue where the /tmp directory is full and has 100000 sess\_ files from PHP.

This is due to the fact that there is no mechanism to remove these files on a regular basis. There is a mechanism within Ubuntu for apache and php-fpm but not openlitespeed. You can use the following commands to create a service that runs and clears out the files.

```auto
systemctl stop phpsessionclean.service
systemctl disable phpsessionclean.service
systemctl stop phpsessionclean.timer
systemctl disable phpsessionclean.timer
echo "*/30 * * * * root find -O3 '/tmp' -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin +180 -delete" > /etc/cron.d/openlitespeed-phpsessionclean

```

In the above code, the following occurs.

1. The first 4 commands are to disable the `phpsessionclean` service and timer, which normally runs the `/usr/lib/php/sessionclean` script.

This is the contents of the phpsessionclean.service file

```auto
[Unit]
Description=Clean php session files

[Service]
Type=oneshot
ExecStart=/usr/lib/php/sessionclean
ProtectHome=true
ProtectSystem=true
PrivateTmp=true

```

1. The final command creates the `/etc/cron.d/openlitespeed-phpsessionclean` cronjob file, which runs every 30 minutes and deletes php sessions files that had their status changed more than 180 minutes ago.
