DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
VGSources
Blog

Fix PHP Session Errors: “No Space Left on Device” (Errno 28)

A PHP errno 28 session error can mean a full disk or exhausted inodes. Find the effective session.save_path, check the correct mount, clean safely, repair retention, and move sessions when necessary.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PHP’s session_start() or session_write_close() error, “No space left on device” with errno 28, means PHP cannot create or update a session file. The affected filesystem may have run out of storage blocks, or it may have exhausted inodes even though several gigabytes appear free. Find the effective session.save_path, check both conditions on that mount, free only safe data, then repair cleanup or move sessions to a suitable store.

The quickest reliable recovery is to identify the session directory, run df -h and df -i against its filesystem, inspect session-file growth and other consumers, and restore a small amount of headroom. Treat a path change as a configuration change: create a writable directory for the PHP worker, set it before session_start(), apply it consistently to every worker, and test a real login and session write.

As an Amazon Associate I earn from qualifying purchases.

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

What errno 28 means for PHP sessions

PHP’s default files session handler stores one file per session in the directory named by session.save_path. The PHP Documentation Group describes this setting as follows: “session.save_path defines the argument which is passed to the save handler.” With the files handler, that argument identifies where session files are created and updated.

When the operating system returns ENOSPC, PHP reports errno 28. The error can appear while opening a new session in session_start(), while writing changes during session_write_close(), or at another point where the handler needs to create, extend, rename, or replace a file. It is not proof that the PHP code itself has a syntax or logic error.

#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

Full blocks versus full inodes

A filesystem tracks both the bytes available for file contents and the inodes available for file records. A server can have free gigabytes but no inodes left. A session workload that creates very large numbers of small files can therefore fail with errno 28 before the byte-capacity graph reaches 100 percent.

  • Blocks exhausted: large logs, backups, uploads, cache data, container layers, or session contents consume the filesystem’s capacity.
  • Inodes exhausted: the filesystem has no file records left for another session file, even when df -h still shows space.
  • Wrong or constrained mount: the configured directory may be on a small /tmp, /var, or container-specific filesystem rather than the disk you normally monitor.

Temporary storage is a frequent location for this failure. Control-panel environments have reported PHP sessions filling a partition under /tmp, and pfSense displays warnings involving paths such as /tmp/sess_XXXXXX. The path in your own runtime configuration, not the path used by another server, determines what must be checked.

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

Step 1: identify the path PHP is actually using

Do not assume that the global php.ini value is the value used by the request that failed. Pool settings, per-directory configuration, a container image, or application code can override it. A value can also contain optional semicolon-delimited arguments for the save handler, so extract the directory portion carefully.

Inspect the runtime value

Use a diagnostic request in the same PHP runtime as the failing application. Before starting a session, print the configured value:

<?php
echo session_save_path(), PHP_EOL;
echo ini_get('session.save_path'), PHP_EOL;
?>

session_save_path() returns the current path used by the session module. Calling it before session_start() is important when the application sets a path in code. Compare the output with the web worker, command-line PHP, and any separate pool that handles the affected site; those runtimes can have different configuration.

Separate a directory from handler arguments

Some session.save_path values use semicolons to carry mode or directory-level arguments. The filesystem check must target the actual directory, not the entire unparsed string. If the value is generated by a platform or hosting panel, use that platform’s displayed session directory and confirm it from the running request.

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

Step 2: check capacity and inodes on the affected mount

Run the checks against the resolved session directory. Checking the root filesystem alone can miss a full temporary or container mount.

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
# A compact inode view is also useful
df -hi /path/to/session-directory

df -h reports block capacity. df -i reports inode use and availability. A result at or near 100 percent in either view explains why creating a session file fails. If both are healthy, continue looking for permissions, a read-only mount, a quota, or a path mismatch rather than deleting files at random.

Check likely temporary locations

If the runtime value points into temporary storage, inspect that exact mount:

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

Only the mount containing the session directory matters for this error, but adjacent mounts can reveal a broader capacity incident. In containers, the path may resolve to a writable layer with a much smaller limit than the host disk.

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

Step 3: find what consumed the space or inodes

After confirming which resource is exhausted, measure the directories on that mount. Look for both unusually large files and enormous counts of small files.

Inspect the session directory

Count and size the files without changing them. Use the host’s approved disk-usage tools or panel to measure the directory, then examine file ages and naming patterns. A large count of files named with the platform’s session prefix indicates session accumulation; a small count of huge files points elsewhere.

  • Session files that are old well beyond the application’s intended lifetime.
  • Logs that were never rotated or that grew during an incident.
  • Application caches, upload spools, and temporary exports.
  • Container layers or build artifacts on the same mount.
  • Deleted files still held open by a running process, which continue consuming blocks until that process closes them.

An open deleted file will not appear in a normal directory listing. If usage remains high after removing a confirmed file, have the system administrator check processes holding deleted files and restart or reload them through the platform’s supported procedure.

Distinguish a session flood from unrelated growth

Session files are usually numerous and individually small. If the inode percentage is critical while byte usage is moderate, prioritize file counts and retention. If byte usage is critical with relatively few files, inspect logs, uploads, backups, and container storage before touching sessions. The corrective action depends on which consumer is responsible.

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.
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

Step 4: restore headroom without destroying active sessions

Free a small, verified amount of space first so PHP can write again. Remove only files you can identify as expired or disposable under the host’s ownership, retention, and compliance rules.

Clean expired session files safely

  • Confirm the directory is the effective path for the failing PHP runtime.
  • Use the application’s documented session lifetime and the host’s retention policy to define what is expired.
  • Delete only files older than that policy, preserving ownership rules and avoiding unrelated files in the same temporary directory.
  • Record the cleanup and recheck both df -h and df -i.

Blindly deleting every session file may log users out, invalidate carts or workflows, and interfere with an application that expects a session to persist. During a severe outage, deleting confirmed stale files can be appropriate, but treat active-session removal as an explicit operational decision rather than a routine command.

Handle logs and other disposable data through supported mechanisms

Rotate or truncate logs using the operating system, hosting panel, or container platform’s supported mechanism. Do not remove a live log file if the service expects to keep its file descriptor; rotation through the service avoids leaving a deleted file open. Apply the same caution to caches, upload spools, and temporary exports: verify that they are reproducible or already beyond retention before removal.

Retest immediately

After headroom is available, test the exact operation that failed: load a page that calls session_start(), authenticate, change a session value, and complete a request that invokes session_write_close() or otherwise ends the request. A successful page load alone does not prove that the write path works.

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

Step 5: repair garbage collection and retention

Cleanup must cover the directory PHP is actually using. Set an appropriate session.gc_maxlifetime for the application’s longest legitimate idle period, then verify that garbage collection runs for that path.

Why setting a lifetime may not be enough

PHP’s request-time garbage collection is probabilistic and can be disabled or replaced by a distribution’s scheduled cleanup job. Some environments deliberately turn off request-time collection and run a periodic task instead. If the application overrides session.save_path, a scheduled job that cleans only the default directory will not reclaim those files.

Make the cleanup policy match the deployment

  • Document the effective session directory for each PHP worker or pool.
  • Check whether request-time garbage collection is enabled.
  • If a scheduled cleanup job is used, confirm that it includes every custom session path.
  • Set retention long enough for legitimate users but short enough to prevent unbounded accumulation.
  • After changing the policy, watch file age and count rather than assuming the next request will remove old files.

Changing the lifetime controls eligibility for cleanup; it does not instantly reclaim existing files. A one-time cleanup may still be required to restore headroom.

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.

Step 6: move sessions when the current filesystem is unsuitable

Relocation is appropriate when the current mount is small, routinely reaches its inode limit, is shared with volatile data, or cannot provide reliable cleanup. Choose a writable filesystem with sufficient blocks and inodes, and keep permissions restrictive.

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

Set the path before the session starts

Application code can set a path before opening a session:

<?php
session_save_path('/srv/php-sessions');
session_start();
?>

The equivalent runtime or pool configuration must be applied before any code calls session_start(). If a framework initializes sessions earlier than your bootstrap file, configure the path in the framework’s supported startup setting or in the PHP worker configuration instead.

Create and secure the destination

  1. Create the destination on the filesystem you selected.
  2. Assign ownership to the PHP worker account or group that writes sessions.
  3. Apply restrictive permissions so only the required service accounts can read session contents.
  4. Confirm that the worker can create, read, modify, and remove a test file in the directory.
  5. Deploy the same path and permissions to every worker that may receive a request.

Do not place session files in a directory that is writable by unrelated users. Sessions commonly contain authentication state or other private data, so a path that is merely writable but broadly readable is not an acceptable fix.

Account for restarts and multiple nodes

Local sessions may disappear when a container or ephemeral instance is replaced. That can be acceptable for a stateless design, but it will sign users out. If several web nodes serve the same application, each node needs a shared session store or consistent routing to the node that owns a session. A path that exists only on one machine will produce intermittent logouts or new errno 28 failures on another.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choosing a session storage arrangement

Evaluate the options against the conditions that caused the incident, not just raw disk size.

Arrangement Blocks and inodes Cleanup responsibility Permissions and security Persistence and node sharing
Existing local directory such as /tmp Bound by that mount; can fail on blocks or inodes Depends on request-time garbage collection or a job that covers the path Must be writable by the PHP worker and protected from unrelated users May be cleared on restart and is local to one host
Dedicated local filesystem Can provide a separate block and inode budget Requires an explicit retention and cleanup policy Ownership and restrictive permissions are under your control Usually persists on that host; does not automatically serve other nodes
Shared or remote session handler Capacity and inode limits belong to the session service or shared filesystem Must be operated and monitored as a separate service Requires secured network access and service credentials Designed for multiple web nodes when configured consistently

A larger disk does not correct inode exhaustion, a faster disk does not repair disabled cleanup, and neither solves a path that points to the wrong mount. Select storage only after measuring the actual failure mode.

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

Step 7: verify the complete fix

  1. Print the effective session.save_path from the production PHP runtime.
  2. Run df -h and df -i on the mount containing that path.
  3. Confirm the destination is writable by the PHP worker and has restrictive access.
  4. Start a new session, authenticate, change a session value, and complete a request that writes it.
  5. Check that the session file or remote record is created and updated where expected.
  6. Repeat the test through every PHP pool, container, or web node that can handle traffic.
  7. Continue monitoring after the test so a rapidly recurring fill is not mistaken for a permanent repair.

Monitoring that prevents a repeat incident

Alert on both percentage of used blocks and percentage of used inodes for the mount that stores sessions. Track session-file count and oldest-file age as application-level indicators. A block alert catches growing contents; an inode alert catches a flood of tiny files; file-count and age alerts reveal cleanup failure before either filesystem limit is reached.

Include the effective path in operational documentation and deployment checks. When configuration changes move sessions, update scheduled cleanup, capacity thresholds, permissions, and every worker at the same time. Test cleanup after deployment rather than waiting for a full filesystem to prove that the job covers the new directory.

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

Troubleshooting branches when errno 28 persists

df -h and df -i both show room

Recheck the path from the failing request; you may have inspected a different PHP runtime or mount. Then investigate filesystem quotas, a read-only filesystem, container limits, or a save-handler argument that resolves to another directory. Confirm that the worker can create and update a test file and that the error is still errno 28 rather than a permissions error.

Space returns briefly, then disappears

Measure the growth rate of session files, logs, uploads, caches, and container layers. A disabled or misdirected cleanup job often allows sessions to accumulate again. Check whether a custom path is excluded from scheduled cleanup and whether several workers are writing to different directories.

Only one web node reports the error

Compare the session path, mount capacity, inode availability, ownership, and cleanup schedule on every node. A deployment that updated one worker can leave another on a small or full temporary mount. Shared sessions require a session store reachable by all nodes; local paths require equivalent capacity and configuration on each node.

Users are logged out after cleanup

That is an expected consequence of deleting active session files. Restore the service, then narrow future cleanup to files beyond the documented retention period. If continuity across restarts or nodes is required, use a persistent or shared arrangement and verify its own capacity and cleanup controls.

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

Essential takeaways

  • session.save_path identifies where file-based PHP sessions are written.
  • Errno 28 means exhausted filesystem blocks or exhausted inodes, not necessarily a disk with zero free gigabytes.
  • /tmp is a common failure location when sessions remain on a temporary path without effective cleanup.
  • Run both df -h and df -i on the mount that contains the effective session directory.
  • Free only confirmed disposable data, then fix retention, garbage collection, capacity, or the storage design that caused the buildup.
  • When relocating sessions, create a protected directory owned by the PHP worker, set it before session_start(), and apply the configuration to every worker.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.