What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Errno 28 means PHP cannot create or update a session file because the filesystem that contains session.save_path has run out of disk blocks or inodes. Check both with df -h and df -i, identify the effective session directory, remove only safe expired files, then repair garbage collection or move sessions to a suitable filesystem before testing session_start() again.

What the error means

When PHP uses its default files session handler, each session is stored as a file below the directory specified by session.save_path. The PHP manual describes this setting as the argument passed to the save handler. A request normally creates or reads a file during session_start(), and writes the final data during session_write_close(). If the underlying filesystem rejects a create or write operation, PHP reports ENOSPC, commonly displayed as “No space left on device (28).”

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Space” has two meanings on a Unix-like filesystem:

  • Data blocks: the filesystem has no free bytes for the file’s contents or metadata.
  • Inodes: the filesystem has no free file entries. A directory containing millions of tiny session files can exhaust inodes while gigabytes remain free.

Consequently, deleting one large log file will not fix an inode shortage, and adding disk capacity will not help if the inode pool or the wrong mount is the constraint. The failing mount may be /tmp, /var, a separate volume, or a container layer rather than the root filesystem.

#1 Best Overall
Sale
fanxiang S101 1TB SSD SATA SSD 1TB Internal Solid State Drive SATA III 6Gb/s 2.5" SSD, UP to 520MB/s, 3D NAND TLC, Upgrade Laptop PC and Desktops
  • SPEED UP COMPUTER: The fanxiang 1TB SSD 2.5 Inch SATA SSD achieves blazing read and write speeds of 520MB/s, facilitating rapid file and data transfers
  • UPGRADE YOUR COMPUTER: Compared to HDDs, the 1TB SATA SSD boots up at least 50% faster, enabling instant productivity or gaming sessions
  • LONG-LASTING DURABILITY: The 2.5 SATA SSD 1TB incorporates 3D NAND TLC chips, offering a longer lifespan in writes compared to QLC, ensuring a more reliable data storage solution
  • EXTENSIVE COMPATIBILITY: The S101 1TB SATA III SSD is compatible with desktops, laptops, all-in-one PCs, supporting various operating systems like Windows, Linux, and Mac OS, meeting the needs of diverse devices
  • 3-Year Service: Fanxiang S101 1TB SSD solid state drive provides 3 years after-sales service and lifetime technical support. If you have any questions, please contact us and we will sincerely and professionally solve the problem for you

Confirm which session path PHP is actually using

Do not assume that the command-line PHP configuration is the same as the web worker’s configuration. PHP-FPM, Apache, a control panel, and the CLI can load different php.ini files or pool overrides.

Inspect the runtime value in PHP

Run this code in the same execution context as the failing application, and run it before session_start():

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<?php
header('Content-Type: text/plain');
echo "SAPI: ", PHP_SAPI, PHP_EOL;
echo "session.save_path: ", var_export(ini_get('session.save_path'), true), PHP_EOL;
echo "session_save_path(): ", var_export(session_save_path(), true), PHP_EOL;
?>

session_save_path() returns the path currently used by the session module. Treat the output as sensitive operational information and remove the diagnostic page after use.

Read the setting from the command line

php --ini
php -r 'var_dump(PHP_SAPI, ini_get("session.save_path"), session_save_path());'

Use the web-runtime diagnostic if the error occurs only through a browser. A CLI value such as /var/lib/php/sessions does not prove that PHP-FPM uses that directory.

Parse semicolon-delimited save paths correctly

A files-handler value can contain optional arguments before the directory, for example 2;0600;/var/lib/php/sessions. The first value can control directory hashing and another can specify a mode. The actual filesystem path is the directory portion after the final semicolon, not the complete string. Copying the whole value into a shell command or creating a directory named after the entire string checks the wrong location. Preserve the mode and hashing arguments when changing configuration unless you have a deliberate reason to alter them.

Check both blocks and inodes on the affected mount

Once you have the real directory, ask the operating system which filesystem contains it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
fanxiang 1TB SATA SSD 2.5'' SSD SATA III 6 Gb/s Internal Solid State Drive Up to 560 MB/s 3D NAND SLC Cache for Laptop and PC Desktop Performance Boost 7mm(0.28″) S101Q
  • High-Efficiency Performance: The SSD 1TB SATA adopts 3D NAND flash memory, which achieves a read speed of up to 560MB/s and a write speed of up to 510MB/s. Get a faster data transfer experience and improve your work efficiency.
  • Upgrate Your Computer: The SATA 1TB SSD achieved faster app load and response times, and faster boot-up and shut-down, compared to HDDs. The internal SSD adopts advanced SLC Cache Technology, which improves overall computer performance.
  • Reliability and Stability: The 2.5 SSD 1TB supports garbage collection, advanced wear-leveling technology, RAID, ECC, TRIM, and S.M.A.R.T, which makes the SATA SSD more reliable and stable. With the characteristics of shockproof, the SSD hard drive can keep your data safe, without worry even if your computer drops.
  • Wide Compatibility: The 2.5'' SSD built-in SATA III 6Gb/S interfaces, witch backwards compatible with SATA II and SATA interfaces. The Internal SATA SSD is compatible with Windows, Linux, and Mac OS, and compatible with laptops, desktops, and all-in-one computers.
  • 3-Year Service: Our SSDs come with a 3 years after-sales service and lifetime technical support. If you have any questions, please contact us and we will sincerely and professionally solve the problem for you.
df -h /path/to/session-directory
df -i /path/to/session-directory

df -h reports byte capacity; df -i reports inode usage. On systems where human-readable inode output is useful, use df -hi. A result at 100% in either report can produce errno 28. Also check the likely temporary and variable-data mounts:

df -h /tmp /var
df -i /tmp /var

If the session directory is inside a container, check from inside the container as well as on the host. Overlay filesystems and container writable layers can have limits that are not obvious from the host’s free space.

Observation Likely constraint Next check
df -h is 100%, df -i has free inodes Byte blocks are exhausted Find large logs, uploads, caches, backups, and layers on that mount.
df -i is 100%, df -h has free space Inodes are exhausted by many files Count small files and inspect session, cache, mail-spool, and temporary directories.
Both reports look healthy for the path The failing worker may use another path, mount, quota, or container layer Verify the web-runtime value and check user, project, and container quotas.
Only session_write_close() fails The session grew or the filesystem filled during the request Check current usage, session payload size, and other files created by that request.

Find what consumed the capacity

Measure the session directory and its neighbors rather than deleting files at random:

du -sh /path/to/session-directory
du -xhd1 /path/to/session-directory | sort -h
find /path/to/session-directory -type f | wc -l
find /path/to/session-directory -type f -printf '%TY-%Tm-%Td %TH:%TM %s %pn' | sort | head

The exact du options differ between GNU and BSD systems; use the local equivalent if -d or -x is unavailable. Look for both unusually large files and an unexpectedly high file count. Session files are often small, so a directory can exhaust inodes without appearing large in du -sh.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect other directories on the same mount for runaway logs, upload spools, package caches, database temporary files, and container layers. A session error can be a symptom of an unrelated consumer.

Check deleted files still held open

Removing a log does not return its blocks while a process still has the file open. On systems with lsof, run:

Rank #3
Sale
Samsung SSD 870 EVO SATA III 2.5” 1TB, Read Speeds Up to 560MB/s | SATA Internal Solid State Drive, Upgrade PC or Laptop Memory & Storage for IT Pros, Creators, Everyday Users (MZ-77E1T0B/AM)
  • THE SSD ALL-STAR: The latest 870 EVO has indisputable performance, reliability and compatibility built upon Samsung's pioneering technology. S.M.A.R.T. Support: Yes
  • EXCELLENCE IN PERFORMANCE: Enjoy professional level SSD performance which maximizes the SATA interface limit to 560 530 MB/s sequential speeds,* accelerates write speeds and maintains long term high performance with a larger variable buffer, Designed for gamers and professionals to handle heavy workloads of high-end PCs, workstations and NAS
  • INDUSTRY-DEFINING RELIABILITY: Meet the demands of every task — from everyday computing to 8K video processing, with up to 600 TBW** under a 5-year limited warranty***
  • MORE COMPATIBLE THAN EVER: The 870 EVO has been compatibility tested**** for major host systems and applications, including chipsets, motherboards, NAS, and video recording devices
  • UPGRADE WITH EASE: Using the 870 EVO SSD is as simple as plugging it into the standard 2.5 inch SATA form factor on your desktop PC or laptop; The renewed migration software takes care of the rest
sudo lsof +L1

Look for large deleted files owned by a long-running web, logging, or application process. Use the service’s supported log-reload or restart procedure; do not kill an arbitrary process in production.

Recover safely when the mount is full

First create a small amount of headroom so the application, shell, and logging system can function. Record the current owner, group, permissions, and retention policy before changing anything.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Preview expired session files

find /path/to/session-directory 
  -type f -name 'sess_*' -mmin +1440 -print | head -100

The example lists files older than 24 hours; choose an age that matches the application’s configured lifetime and business requirements. File modification time is only a cleanup signal, not proof that a session is unused. A long-lived login, a background request, or clock skew can make a file appear old.

Delete only confirmed disposable files

After validating the preview and obtaining the required operational approval, delete only files that match the host’s session naming and retention rules:

find /path/to/session-directory 
  -type f -name 'sess_*' -mmin +1440 -delete

Do not run a broad rm -rf against /tmp, the entire session parent, or a path assembled from unverified configuration output. Deleting active sessions logs users out and may violate application or compliance requirements. If the directory is shared by multiple applications, identify ownership before removing anything.

Free unrelated space through supported mechanisms

Rotate logs with the platform’s log-rotation command, truncate only a confirmed disposable log when rotation cannot run, and clear caches using the package manager or application’s documented command. Keep an audit trail of what was removed. Once a few megabytes or a meaningful number of inodes are available, retry a login and a request that writes session data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Fikwot FX815 1TB SSD, 2.5" SATA SSD, Internal Solid State Drive, Up to 560MB/s, 3D NAND SLC Cashe, Compatible with Laptop & PC Desktop
  • 【Excellent Performance】Upgrade your laptop or desktop computer and feel the difference with super-fast operating system boot times and quick application loads. This SSD offers superior performance compared to traditional hard drives (HDD) and is perfect for gaming, delivering enhanced performance for seamless cutscenes.
  • 【Multi-Scenario Use】The 7mm slim design of the Fikwot FX815 makes it suitable for Ultrabooks and Ultra-slim notebooks. Its large capacity options ranging from 256GB to 2TB cater to various storage needs, whether it be for office documents, entertainment files, or multimedia content.
  • 【3D NAND Flash】The Fikwot FX815 adopting 3D NAND flash memory components, supporting mechanisms such as LDPC ECC error correction and intelligent SLC cache, configured with SATA 3.0 high-speed interface, the maximum read and write speed can reach 560 MB/s, 510 MB/s.(ssd internal hard drive)
  • 【Long Life】The Fikwot FX815 is shock-resistant, vibration-resistant, and reduces noise interference, providing a durable and quiet storage solution.Enjoy extended battery life as this SSD consumes 45x less energy than a typical hard drive.(ssd hard drive internal)
  • 【After-Sales Service】The Fikwot FX815 SSD comes with 3 years or 320 TBW (Terabytes Written) product maintenance, giving you peace of mind and reliable performance. The official website provides technical support and customer service.

Repair garbage collection and retention

Emergency deletion treats the symptom. The recurring cause is often an unsuitable lifetime, disabled request-time garbage collection, or a cleanup job that does not cover a custom path.

Check the effective lifetime

session.gc_maxlifetime is the age, in seconds, after which session data is eligible for garbage collection. It is not a guaranteed deletion time: collection runs only when the configured cleanup mechanism runs, and the probability-based request trigger can be disabled or ineffective in some distributions.

php -i | grep -E 'session.save_path|session.gc_maxlifetime|session.gc_probability|session.gc_divisor'

Confirm these values in the web worker’s environment, not just the CLI. Set a lifetime that matches the application’s security and user-experience requirements; making it extremely long increases storage pressure, while making it too short logs users out unexpectedly.

Verify how cleanup is scheduled

Some operating-system packages disable request-time garbage collection and use a scheduled job to remove old files. Check the distribution’s timer, cron entry, or control-panel task and confirm that it points to the same directory as the running application. If the application overrides session.save_path, a cleanup job aimed at the default directory will leave the override untouched.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a custom directory, use a cleanup process that understands its ownership, hashing layout, retention period, and concurrency. Test it on a staging copy or with a dry-run listing before enabling deletion.

Move file sessions to a suitable filesystem

Relocation is appropriate when the current mount is small, shared with volatile data, or repeatedly reaches its inode limit. Choose a filesystem with enough blocks and inodes, predictable persistence, and a backup and monitoring policy appropriate for session data.

Best Value
Crucial BX500 1TB 3D NAND SATA 2.5-Inch Internal SSD, up to 540MB/s - CT1000BX500SSD1, Solid State Drive
  • Boot up faster. Load files quicker. Improve overall system responsiveness
  • 300% faster than a typical hard drive
  • Improves battery life because it’s 45x more energy efficient than a typical hard drive
  • Micron 3D NAND – advancing the world's memory and storage technology for 40 years
  • Crucial 3-year limited warranty

Create and secure the directory

sudo install -d -m 1730 -o php-fpm-user -g php-fpm-group /var/lib/myapp/sessions
sudo df -h /var/lib/myapp/sessions
sudo df -i /var/lib/myapp/sessions

Replace php-fpm-user and php-fpm-group with the account that actually writes sessions. The exact mode depends on whether a cleanup job or multiple workers need directory access. Use the least privilege that permits the PHP worker and cleanup process to operate; never make session storage world-readable.

Set the path before starting the session

For a deliberate per-application override:

<?php
session_save_path('/var/lib/myapp/sessions');
session_start();
?>

Alternatively set session.save_path in the PHP-FPM pool, server configuration, or the application’s supported configuration layer. The setting must take effect before session_start(); changing it after a session has already started does not move the current session file. Deploy the same effective setting to every worker process and restart or reload workers according to the platform’s configuration procedure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep cleanup aligned with the new location

Update the scheduled cleanup job, monitoring rules, backups, and incident runbooks to use the new directory. Test that a request can create, read, update, and close a session, then confirm that the resulting file has the expected owner and mode.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Decide between local files and a shared session store

A local directory is simple and fast when one server, or a load balancer with session affinity, handles the application. It becomes fragile when workers are replaced, containers are ephemeral, or several web nodes must read the same session.

Option Blocks and inodes Cleanup Permissions and security Persistence and multi-node behavior
Local filesystem Consumes the selected mount; monitor both resources. Requires reliable garbage collection or a scheduled job. Simple to secure with ownership and restrictive modes. May disappear on restart or container replacement; not shared unless storage is shared.
Dedicated local volume Separates session pressure from logs and application data, but still has finite blocks and inodes. Same cleanup obligations as any files handler. Allows a narrowly scoped mount and access policy. Can persist across application restarts if the volume is managed for that purpose.
Shared or remote handler Moves pressure to the service’s storage limits rather than the PHP host’s inode pool. Uses the handler’s expiry and eviction controls; monitor them separately. Requires network authentication, encryption decisions, and carefully limited access. Suitable for multiple web nodes, but introduces network and service availability dependencies.

A larger or faster disk is not, by itself, a fix for a wrong path, disabled cleanup, incorrect permissions, or an inode limit. Select the handler based on node topology, failure behavior, data sensitivity, and operational ownership.

Troubleshoot by symptom

session_start() fails immediately

  • Print the web-runtime session.save_path and verify that the directory exists.
  • Run df -h and df -i against that exact path.
  • Check that the PHP worker can traverse the parent directories and create a file.
  • Inspect quotas, container limits, and mandatory access-control denials if both reports show free capacity.

session_write_close() fails after the request runs

  • Check whether the session payload became unexpectedly large.
  • Compare filesystem usage before and after the request; another operation may have filled the mount.
  • Look for application code that changes session.save_path or opens a second session path.
  • Inspect PHP and web-server logs for the precise path and operation that failed.

Cleanup appears to run but files return

  • Confirm that the job runs as a user able to remove files and enter every hashed subdirectory.
  • Compare the job’s configured directory with the value returned by the web runtime.
  • Check whether several applications share one directory with different lifetimes.
  • Measure file creation rate; cleanup can be correct yet too infrequent for a sudden traffic spike.

Users are logged out after the fix

Deleting session files necessarily invalidates those sessions. A path change can also make old files invisible to the new handler. Plan the change as a session reset, communicate it when appropriate, and verify that new logins persist across requests. Do not copy session files between incompatible handlers or applications without confirming their format and security assumptions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Monitor before the next outage

Alert on both block and inode percentages for every filesystem that can contain sessions. Add session-file count, oldest-file age, directory size, cleanup-job success, and PHP error rates to the same dashboard. Useful alert conditions include:

  • Rapid growth in session-file count or oldest-file age.
  • Inode utilization rising while byte utilization remains modest.
  • Cleanup jobs failing, skipping a custom path, or running slower than the creation rate.
  • Repeated errno 28 messages from session_start() or session_write_close().

After remediation, test a fresh login, an authenticated request that changes session data, and a logout or session-destroy operation. Continue watching the mount long enough to cover the application’s normal traffic cycle; a one-time deletion does not prove that retention and cleanup are fixed.

Quick recovery checklist

  1. Capture the effective web-runtime value of session.save_path before session_start().
  2. Resolve the actual directory if the value includes semicolon-delimited options.
  3. Run df -h <path> and df -i <path>; check quotas and container limits when necessary.
  4. Measure sessions, logs, caches, uploads, and open deleted files on that mount.
  5. Free a small, approved amount of space or inodes using targeted cleanup.
  6. Test session creation and writing.
  7. Set an appropriate lifetime and repair the cleanup job for the actual path.
  8. Move sessions or adopt a shared handler if the mount or topology requires it.
  9. Verify worker ownership, restrictive permissions, deployment consistency, and monitoring.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.