Short answer: On a cPanel server running LiteSpeed Web Server, “503 Service Unavailable” almost always means LiteSpeed could not get an answer from lsphp: the account hit PHP suEXEC Max Conn (“Reached max children process limit”), a CloudLinux EP/NPROC/memory limit, lsphp crashed, or the server ran out of memory or file descriptors. Read stderr.log and the error log for the account’s UID, fix the limit it names, then restart detached PHP processes and retest.
Applies to cPanel & WHM with LiteSpeed Web Server Enterprise
Commands and settings checked against the official LiteSpeed and cPanel documentation (linked below) on 7 October 2026; not yet run on our lab servers. Our cPanel 11.138 lab runs Apache 2.4.69, not LiteSpeed, so the only thing we confirmed there is that /usr/local/apache/logs is a symlink to /etc/apache2/logs.
Table of Contents
What “503 Service Unavailable” means on LiteSpeed
LiteSpeed serves static files itself and hands PHP to lsphp processes over a socket. When it cannot start an lsphp process, cannot connect to it, or the process dies before answering, the visitor gets a 503. The web server is usually fine; the PHP side is not. Two other codes look similar but have different causes:
- 508 Resource Limit Is Reached: CloudLinux refused a new entry process for the account (EP limit). See our 508 guide.
- 500 Internal Server Error: PHP ran and failed, or
.htaccesshas a bad directive. Check the account’s PHP error log first.
Before changing anything, LiteSpeed’s cPanel documentation suggests one quick test: switch the server to Apache briefly. If the 503 turns into a working page, the cause is in LiteSpeed’s PHP limits; if the site still fails, the application itself is broken. Use the WHM plugin (WHM » Plugins » LiteSpeed Web Server, Switch to Apache) or /usr/local/lsws/admin/misc/cp_switch_ws.sh apache, and switch back with cp_switch_ws.sh lsws. LiteSpeed warns not to do this with service httpd stop / service lsws start.
Where the LiteSpeed logs are on cPanel
On cPanel, LiteSpeed reads Apache’s configuration and writes to Apache’s log locations. LiteSpeed’s own install directory has a logs folder too, so check both:
| Log | Path on cPanel | What it tells you |
|---|---|---|
| stderr log | /usr/local/apache/logs/stderr.log (cPanel’s 503 article) or /usr/local/lsws/logs/stderr.log | What lsphp printed before it died: fork failures, memory errors, PHP startup errors |
| Server error log | /usr/local/apache/logs/error_log or /usr/local/lsws/logs/error.log | Connection refused to the lsphp socket, “Reached max children”, “Too many open files” |
| System log | /var/log/messages or journalctl -k | Kernel OOM killer, LFD killing processes |
| PHP error log | Per site, as set in php.ini (often error_log in the site folder) | Fatal errors such as memory_limit exhausted |
On our cPanel lab, /usr/local/apache/logs is a symlink to /etc/apache2/logs, so both paths reach the same files. cPanel’s own article for LiteSpeed 503s says to search stderr.log for the account’s UID:
uid=$(id -u bob)
grep "$uid" /usr/local/apache/logs/stderr.log | tail -20
grep -E "Reached max children|Connection refused|Too many open files|fork\(\) failed|Cannot allocate memory" \
/usr/local/apache/logs/error_log /usr/local/lsws/logs/error.log 2>/dev/null | tail -30
Match the log line to the cause
These strings come from LiteSpeed’s and cPanel’s 503 documentation. Find yours, then go to the matching fix below.
| Log line contains | Cause | Fix |
|---|---|---|
Reached max children process limit: 10, extra: 3, current: 13, busy: 13, please increase LSAPI_CHILDREN | Account used all its lsphp processes | Raise PHP suEXEC Max Conn (within CloudLinux EP) |
connection to [uds://usr/local/lsws/extapp-sock/APVH_username_Suea-php74.sock] ... error: Connection refused! | lsphp for that account crashed or could not start | Read stderr.log for the real error, then restart detached PHP |
[STDERR] fork() failed, please increase process limit: Cannot allocate memory | Memory or process limit hit (lsphp, LVE PMEM/NPROC, or the whole server) | Memory limits in PHP Handler Defaults, CloudLinux limits, RAM |
... error: Too many open files! | LiteSpeed’s file-descriptor limit | Raise the open-files limit for the lsws service |
[STDERR] zend_mm_heap corrupted | Broken PHP extension or OPcache | Disable OPcache or the extension, test again |
lfd[...]: *User Processing* PID:... Kill:1 User:... in /var/log/messages | CSF/LFD killed lsphp | Add lsphp to csf.pignore |
Raise PHP suEXEC Max Conn (and LSAPI_CHILDREN)
In suEXEC mode, every cPanel account gets its own pool of lsphp processes, capped by PHP suEXEC Max Conn. LiteSpeed’s documentation gives the default as 10. When a slow site has 10 requests running, request 11 waits and then fails with 503, logging “Reached max children process limit”. The message tells you to increase LSAPI_CHILDREN, but on cPanel LiteSpeed’s tuning guide says to change PHP suEXEC Max Conn rather than LSAPI_CHILDREN in External Apps.
- Open WebAdmin at
https://203.0.113.10:7080(or from the WHM plugin). - Go to Configuration » Server » General, section Using Apache Configuration File, and find PHP suEXEC Max Conn.
- Raise it moderately, for example 10 to 15 or 20. On CloudLinux, keep it below the account EP limit (see the next section).
- Save, then Actions » Apply Changes / Graceful Restart.
Before you raise it, ask why the processes were busy. Ten PHP workers for one account is a lot of capacity; if they are all stuck on a slow database query or an external API call, more workers just means more stuck processes and more memory. Our stuck lsphp guide shows how to see what each process is doing.
Check CloudLinux EP, NPROC and memory limits
On CloudLinux, LVE limits sit underneath LiteSpeed. EP (entry processes) limits how many requests can enter the account’s LVE at once, NPROC limits total processes inside it, and PMEM limits physical memory. LiteSpeed’s CloudLinux notes say that PHP suEXEC Max Conn should always be lower than the account’s EP limit, and give a rule of thumb of EP divided by the number of CPUs in the LiteSpeed licence. If suEXEC Max Conn is higher than EP, the account hits NPROC or EP first and visitors see 503 or 508 errors.
lvectl list-user | head -20 # configured limits per user (CloudLinux)
If the account is hitting its limits, decide whether to raise them for that package in CloudLinux Manager or to make the site lighter (caching, fixing slow queries). The limits are explained in CloudLinux LVE Limits Explained. LiteSpeed also documents one specific case: if the WebAdmin console itself returns 503 with “cannot allocate memory” on CloudLinux, the lsadm user’s PMEM may be set to 0, which LVE treats literally; their fix is lvectl set-user lsadm --pmem=2G.
Restart crashed or stuck lsphp
If the error log shows “Connection refused” for an account socket, lsphp for that account is gone or broken. Look at what is running first:
ps -o user=,pid=,etime=,rss=,args= -C lsphp | sort | head -40
ps -o user= -C lsphp | sort | uniq -c | sort -rn | head # processes per account
Then restart PHP without restarting the whole web server. LiteSpeed documents two ways:
- WebAdmin: Actions » Restart Detached PHP Processes, then Apply Changes / Graceful Restart.
- Command line:
touch /usr/local/lsws/admin/tmp/.lsphp_restart.txtfollowed bysystemctl restart lsws.
If stderr.log shows zend_mm_heap corrupted or crashes right after start, a PHP extension is the problem. Disable OPcache or the most recently added extension for that PHP version in MultiPHP INI Editor or EasyApache, then restart lsphp again. LiteSpeed lists ionCube, ZendGuardLoader and some security extensions as ones to test first.
Fix memory and open-file limits
For “fork() failed … Cannot allocate memory”, check three layers in order:
- The server:
free -mandjournalctl -k --since "-1h" | grep -i -E "out of memory|oom". If the kernel OOM killer is firing, the server needs more RAM or fewer workers. - LiteSpeed’s lsphp memory limits: WebAdmin Configuration » Server » PHP, edit PHP Handler Defaults, Memory Soft Limit and Memory Hard Limit. LiteSpeed’s 503 guide uses 4097M and 4098M as example values. Then Restart Detached PHP Processes.
- PHP’s own
memory_limitfor the site, if the PHP error log shows “Allowed memory size of … bytes exhausted”.
For “Too many open files!”, check the limit the LiteSpeed service actually runs with:
systemctl show lsws -p LimitNOFILE
ulimit -n
If it is low, raise it with a systemd drop-in (/etc/systemd/system/lsws.service.d/limits.conf with [Service] and LimitNOFILE=...), then systemctl daemon-reload and a restart at a quiet time. LiteSpeed’s own 503 page only mentions ulimit -n, which does not affect a service started by systemd.
If LFD is killing lsphp (the lfd ... *User Processing* lines), LiteSpeed’s fix is to tell LFD to ignore lsphp:
echo "pexe:/usr/local/lsws/fcgi-bin/lsphp.*" >> /etc/csf/csf.pignore
csf -r
systemctl restart lfd
Check that it worked
- Request the page and check the status code:
curl -sI https://example.com/ | head -1should return200(or the redirect the site normally sends), not503. - Load the heaviest page a few times in parallel, for example
for i in $(seq 1 15); do curl -s -o /dev/null -w "%{http_code}\n" https://example.com/ & done; wait, and confirm no 503s. - Watch the logs for a few minutes:
tail -f /usr/local/apache/logs/error_log | grep -E "Reached max children|Connection refused|Too many open files"should stay quiet. - Open Actions » Real-Time Stats in WebAdmin and look at the External Application section for the account: requests should not be piling up in a wait queue. The same data is in
/tmp/lshttpd/.rtreport. - On CloudLinux, check the account in CloudLinux Manager over the next day for new EP, NPROC or PMEM faults.
Common problems
- Auto Fix 503 hides the problem. WebAdmin has an Auto Fix 503 Error option (Server » General) that restarts LiteSpeed after repeated 503s. LiteSpeed describes it as a temporary measure; if it is on, the real cause still needs fixing.
- The 503 only affects one account. That points to that account’s limits or code, not the server. Grep
stderr.logfor its UID. - Every site returns 503 after a PHP update. An extension built for the old PHP version fails to load. Look for “Unable to load dynamic library” or “Unable to initialize module” in
stderr.logand rebuild or disable it. - Raising suEXEC Max Conn made things worse. More workers used more memory and hit PMEM or the OOM killer. Go back to the previous value and fix the slow requests.
- The disk or /tmp is full. lsphp sockets and LiteSpeed swap files live under
/tmp/lshttpd/. A full/tmpcauses 503s on every site; checkdf -h /tmpanddf -i /tmp. - WebAdmin itself shows 503. On CloudLinux this is often the
lsadmPMEM issue described above.
Official documentation: LiteSpeed: 503 errors on cPanel · LiteSpeed: troubleshooting PHP 503 errors · LiteSpeed: CloudLinux troubleshooting on cPanel · cPanel: LiteSpeed 503 errors
Related: Stuck lsphp Processes on cPanel LiteSpeed: Diagnose and Kill Safely · CloudLinux LVE Limits Explained: SPEED, PMEM, EP, NPROC, IO · “508 Resource Limit Is Reached”: Find and Fix the Limit · LiteSpeed Cache WordPress cPanel: Recommended Settings · AI Log Analyzer for Server Logs (Apache, Nginx, Exim, MariaDB)
See also: Stuck lsphp Processes on cPanel LiteSpeed: Diagnose and Kill Safely · CloudLinux LVE Limits Explained: SPEED, PMEM, EP, NPROC, IO · “508 Resource Limit Is Reached”: Find and Fix the Limit
Frequently asked questions
What causes 503 Service Unavailable on LiteSpeed?
Usually lsphp, not LiteSpeed itself: the account reached PHP suEXEC Max Conn, hit a CloudLinux limit, lsphp crashed, or the server ran out of memory or file descriptors. stderr.log and the error log name the cause.
What is the default PHP suEXEC Max Conn?
LiteSpeed documents the default as 10 concurrent lsphp processes per account in suEXEC mode. Raise it in WebAdmin under Configuration, Server, General.
Should I raise LSAPI_CHILDREN or PHP suEXEC Max Conn on cPanel?
LiteSpeed’s cPanel tuning guide says to adjust PHP suEXEC Max Conn in control panel environments rather than LSAPI_CHILDREN in External Apps, even though the log message mentions LSAPI_CHILDREN.
How do I restart lsphp without restarting LiteSpeed?
In WebAdmin use Actions, Restart Detached PHP Processes, then Graceful Restart. From the shell, touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt and restart lsws.
Is a 503 on LiteSpeed the same as a 508?
No. 508 Resource Limit Is Reached comes from CloudLinux when the account hits its entry process limit. A 503 means LiteSpeed could not get a response from PHP.
Where is stderr.log on a cPanel LiteSpeed server?
cPanel’s support article uses /usr/local/apache/logs/stderr.log. LiteSpeed also keeps logs in /usr/local/lsws/logs/, so check both.
Maintenance record
This guide changes servers, data or security settings, so we re-check it against current versions on a fixed schedule. Take a backup or snapshot before you start.
- Maintained by
- srvScripts editorial team
- Supported versions
- cPanel & WHM with LiteSpeed Web Server Enterprise
- Last full review
- Next review