- HTTP Error 503. The service is unavailable
- Server Side Issue
- Refresh the page
- Using our Apache as Backend Feature
- PHP FPM is down
- Service Unavailable
- Check various log files
- 503 Errors due to PHP Malfunction
- Disable PHP OPCode Caching (xCache, ACP or eAccelerator)
- No space left on /tmp
- PHP memory_limit reached
- max_execution_time reached
- Conclusion
- 503 Service Temporarily Unavailable
- 6 Answers 6
- Laravel Error 503 Service Unavailable Service
- 8 Answers 8
HTTP Error 503. The service is unavailable
Web servers such as LiteSpeed and Apache use various codes to tell browsers about responses. For example, if the webserver replies back with HTTP code 200, it means that everything is fine and the response generation was successful. There are many other response codes, but today we will discuss HTTP Error 503, and when this usually happens you get the following error on your browser: HTTP Error 503. The service is unavailable.
If you are not the administrator of the site, there is nothing much you can do as mostly this error indicates that there is something wrong on the server-side. You can either refresh the page, visit later or better notify an administrator of the site. However, if you are the administrator of the site, you can do much to figure out what is wrong and there are various reasons and ways to fix this error. There are multiple web servers, each may give you a slightly different error message, such as:
Usually, the main thing to look for is error code which is HTTP error code 503. Today we will see how we can discuss various reasons and respective ways to fix the issue.
Server Side Issue
Before deep-diving into various reasons as to why this could happen, I would again like to mention that this is a server-side issue. All errors in the 5xx range are considered errors on the server side including 503 Service Unavailable Error. However, do keep in mind that 503 error means the server was able to process your web request and it was functioning properly but it chooses to return 503 error code because due to some problem/issue server is not able to process this request the way it should have.
Refresh the page
Some times you will get the following error
503 Service Unavailable – The server is temporarily busy, try again later!
It may really be a temporary error as the error message says, so wait some time and refresh the page. This can happen to high traffic sites, where enough resources are not available to handle the request. On the user end, be careful if you are seeing this error on the payment related pages, and make sure you won’t get charged twice.
Using our Apache as Backend Feature
If you are our customer and using our Apache as Backend feature, there is a chance that Apache is down. In this case frontend server which is OpenLiteSpeed, will give you a 503 error, as it is failed to connect to Apache. See if Apache is running
If Apache service is not running, you can start with
And see if your issue is resolved.
PHP FPM is down
If you get something like (Assuming you are using our Apache as backend feature or your stack includes PHP-FPM)
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
This means your PHP-FPM service is down. You can start php-fpm using
In case you are our customer, there are multiple PHP-FPMs are available for different PHP versions and their respective commands are:
systemctl start php54-php-fpm
systemctl start php55-php-fpm
systemctl start php56-php-fpm
systemctl start php70-php-fpm
systemctl start php71-php-fpm
systemctl start php72-php-fpm
systemctl start php73-php-fpm
Check various log files
If your issues are still not resolved, you can start to check various log files. In the case of CyberPanel and LiteSpeed (OpenLiteSpeed), log files to check are:
You can do an efficient search of log files using the grep command such as:
cat log_file_path | grep error
cat log_file_path | grep notice
This command will make sure that you only get the most relevant information, otherwise, you may also get info level messages in your log files and they are not relevant in this case.
503 Errors due to PHP Malfunction
Most of the time 503 errors can come due to a problem in your PHP code, or either PHP-FPM/LSPHP are not able to produce response thus server started giving you 503 error. It is always recommended to first create a phpinfo page and see if your PHP side is working fine. If you can see the phpinfo page, you can move forward to further debug the cause, otherwise, make sure LSPHP is working fine and external application is created properly or PHP-FPM is up and running.
Disable PHP OPCode Caching (xCache, ACP or eAccelerator)
On a default install of CyberPanel (OpenLiteSpeed or LiteSpeed Enterprise), OPCode caching is enabled. Sometimes different sorts of opcode caching can have compatibility issues with LSPHP (PHP). So if you are getting HTTP Error 503 Error better try to disable opcode caching. On CyberPanel you first need to find out which PHP version is used by your site. To find out your PHP version on CyberPanel run the following command
cat /usr/local/lsws/conf/vhosts/yourdomain.com/vhost.conf | grep php
For example, the PHP version of your site is 7.2. Go to the configurations directory of PHP 7.2 and disable opcode caching.
cd /usr/local/lsws/lsphp72/etc/php.d
mv 10-opcache.ini 10-opcache.ini.bak
systemctl restart lsws
or
/usr/local/lsws/bin/lswsctrl restart
This will disable OPCode caching. If you are not on CyberPanel, you need to find the php.ini file for your PHP and disable OPCode caching. Usually, php.ini location is disclosed in phpinfo page. If your issue is still not resolved, you can move on to the next step.
No space left on /tmp
Some web application use /tmp directory to store temporary files (session data etc). If /tmp is full you can get HTTP Error 503 Error. Use the following commands to inspect /tmp directory space
PHP memory_limit reached
memory_limit is a php directive that specifies how much memory a PHP script is allowed to allocate. Sometimes your application might be exceeding this limit, thus failed to produce response for the web server resulting in HTTP Error 503 Error. As explained above, first find out the PHP version used by your site. Then you can directly increase memory_limit from CyberPanel interface.
Login to your CyberPanel Dashboard then from left sidebar PHP -> Edit PHP Configs
- Select PHP version to change the value of memory_limit directive.
Finally, scroll down and click Save Changes.
max_execution_time reached
max_execution_time is similar to memory_limit. So if your PHP script exits early without producing response again you will get the same error. You can follow the same procedure as described above to fix max_execution_time as well. Make sure to set it to a high enough value so that your script is properly executed.
Conclusion
We’ve pretty much discussed all the possible causes of “HTTP Error 503. The service is unavailable”. However, we recommend moving your sites to CyberPanel, because CyberPanel use LiteSpeed servers. This means in low-cost VPS you can host more sites, and using LSCache WordPress plugin you can avoid many such errors including HTTP Error 503. Because if your pages are cached, PHP engine is not used, thus giving other applications more resources to run. So in a low cost server you can run multiple sites at super fast speed and avoid such errors. You can learn in our OpenLiteSpeed vs NGINX comparision post as to why you would use CyberPanel and OpenLiteSpeed.
You can also get our managed vps and let us do this for you. We offer 3 days trial (no credit card required, plus free migration and fully managed support)
503 Service Temporarily Unavailable
I understand this error is fairly common, but I’ve come to a bit of a dead end in terms of debugging the issue. I’m running windows 8.1 with WAMP. I have multiple websites running from the WAMP configuration, most of them being Drupal sites and a couple being CS-Cart sites. The one I’m having an issue with is the CS-Cart site. I’ve setup my hosts/vhosts file in exactly the same way I’ve set up all of my existing sites. However when I go to the browser and try and view the site, I get a ‘Service unavailable’ message. In my console it turns out it’s a ‘503 Service Temporarily Unavailable’ . I’ve checked the database settings and I have an .htaccess file. Here is an example of my hosts file config:
ServerAdmin email@email.com DocumentRoot "C:/wamp/www/website-location" ServerName local.website.co.uk ErrorLog "logs/local.website.co.uk-error.log" CustomLog "logs/local.website.co.uk-access.log" common 127.0.0.1 local.website.co.uk
I’ve checked the error logs and it’s not printing anything at all. The only thing I can see are the HTTP requests in the access file. Any help would be much appreciated.
6 Answers 6
Ok, So I managed to sort out the issue. Turns out the issue was in the Database. There is a table called ‘CSCART_COMPANIES’ , the domain was pointing to the staging site as opposed to the local site.
Hopefully this helps others out in the future.
Not sure if older installs had this, but there is another company_website row found in cscart_settings_objects table that should prob be changed as well if its not already. Also, there is a license key there too that is domain based if you are changing domain names.
Laravel Error 503 Service Unavailable Service
Error 503 Service Unavailable Service Unavailable Guru Meditation: XID: 5312211 Varnish cache server I working on cpanel and subdomain but i got this error from laravel project. do you can help me to solve this? I using cpanel and laravel 5.5
8 Answers 8
Looks like you ran the artisan down command, but not the up command. Just run:
For the curious, the php artisan down command writes a file to storage/framework/down , the presence of which signals the condition in question. Conversely, php artisan up deletes the aforementioned file.
if have tried php artisan up command and your site still not up and gives 503 then ,
delete down file inside /storage/framework/
I had the same problem in Cpanel what i have did to fix this.
I just have fixed PHP version to the latest then I goes to «Shell option in panel» and entered this command and my app is live now. php artisan up
The cause of the error likely stems from Apache and PHP-FPM becoming overloaded with requests. PHP-FPM, and occasionally Apache, will need adjustments to their limitations to get around this.
To start, we recommend attempting to adjust the PHP-FPM pool limits from within the WHM «MultiPHP Manager.» To do so globally:
[1] Access WHM >> MultiPHP Manager [2] Select "System PHP-FPM Configuration" [3] Adjust the "Max Children" and "Max Requests" fields. We recommend incrementing in values of 5 to 10 to ensure that PHP-FPM does not get overloaded. [4] Save your configuration settings To perform these changes by domain: [1] Access WHM >> MultiPHP Manager [2] Scroll down and locate a domain that experiences the problem. [3] Select "Edit PHP-FPM" for the domain in question. [4] Adjust the "Max Children" and "Max Requests" fields. [5] Save your configuration settings