Question

Error AH01067: Failed to read FastCGI header

Hello, I keep getting this error and my website doesn’t work at all. There is nothing wrong with the PHP code, it is written correctly, on a virtual computer my web server works with the database without any problems.

There will be something wrong with the server settings, where…?

[jecnapss] [2023-02-25 20:48:32] Detected 1.0GiB of RAM
[jecnapss] [2023-02-25 20:48:32] PHP memory_limit is 128M Bytes
[jecnapss] [2023-02-25 20:48:33] Starting php-fpm with 8 workers...
[jecnapss] [2023-02-25 20:48:35] Starting httpd...
[jecnapss] [2023-02-25 20:48:36] Application ready for connections on port 8080.
[jecnapss] [2023-02-25 20:48:58] [25-Feb-2023 20:48:57 UTC] PHP Notice:  Undefined index: login_name in /workspace/admin/topbar.php on line 23
[jecnapss] [2023-02-25 20:48:58] [25-Feb-2023 20:48:57 UTC] PHP Notice:  Undefined index: login_id in /workspace/admin/topbar.php on line 36
[jecnapss] [2023-02-25 20:48:58] [25-Feb-2023 20:48:57 UTC] PHP Notice:  Undefined index: system in /workspace/admin/navbar.php on line 7
[jecnapss] [2023-02-25 20:48:58] [25-Feb-2023 20:48:57 UTC] PHP Notice:  Trying to access array offset on value of type null in /workspace/admin/navbar.php on line 7
[jecnapss] [2023-02-25 20:48:58] [25-Feb-2023 20:48:57 UTC] PHP Notice:  Undefined index: login_type in /workspace/admin/navbar.php on line 19
[jecnapss] [2023-02-25 20:49:33] 10.244.31.108 - - [25/Feb/2023:20:49:33 +0000] "-" 408 - "-" "-
[jecnapss] [2023-02-25 20:49:35] [25-Feb-2023 20:49:35] WARNING: [pool www] child 180, script '/workspace/admin/index.php' (request: "GET /admin/index.php") execution timed out (37.820128 sec), terminating
[jecnapss] [2023-02-25 20:49:35] [25-Feb-2023 20:49:35] WARNING: [pool www] child 180 exited on signal 15 (SIGTERM) after 60.232039 seconds from start
[jecnapss] [2023-02-25 20:49:35] [Sat Feb 25 20:49:35.418051 2023] [proxy_fcgi:error] [pid 197:tid 140112654501632] [client 10.244.2.105:40858] AH01067: Failed to read FastCGI header
[jecnapss] [2023-02-25 20:49:35] [Sat Feb 25 20:49:35.418257 2023] [proxy_fcgi:error] [pid 197:tid 140112654501632] (104)Connection reset by peer: [client 10.244.2.105:40858] AH01075: Error dispatching request to : 
[jecnapss] [2023-02-25 20:49:35] 10.244.2.105 - - [25/Feb/2023:20:48:57 +0000] "GET /admin/ HTTP/1.1" 503 299 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.56
[jecnapss] [2023-02-25 20:49:43] 10.244.31.108 - - [25/Feb/2023:20:49:43 +0000] "-" 408 - "-" "-
[jecnapss] [2023-02-25 20:49:45] [25-Feb-2023 20:49:45] WARNING: [pool www] child 186, script '/workspace/login.php' (request: "GET /login.php") execution timed out (36.135580 sec), terminating
[jecnapss] [2023-02-25 20:49:45] [25-Feb-2023 20:49:45] WARNING: [pool www] child 186 exited on signal 15 (SIGTERM) after 70.134275 seconds from start
[jecnapss] [2023-02-25 20:49:45] [Sat Feb 25 20:49:45.422294 2023] [proxy_fcgi:error] [pid 195:tid 140112654501632] [client 10.244.2.105:47566] AH01067: Failed to read FastCGI header
[jecnapss] [2023-02-25 20:49:45] [Sat Feb 25 20:49:45.422843 2023] [proxy_fcgi:error] [pid 195:tid 140112654501632] (104)Connection reset by peer: [client 10.244.2.105:47566] AH01075: Error dispatching request to : 
[jecnapss] [2023-02-25 20:49:45] 10.244.2.105 - - [25/Feb/2023:20:49:09 +0000] "GET /login.php HTTP/1.1" 503 299 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.56
[jecnapss] [2023-02-25 20:49:53] 10.244.31.108 - - [25/Feb/2023:20:49:53 +0000] "-" 408 - "-" "-
[jecnapss] [2023-02-25 20:50:03] 10.244.31.108 - - [25/Feb/2023:20:50:03 +0000] "-" 408 - "-" "-
[jecnapss] [2023-02-25 20:50:13] 10.244.31.108 - - [25/Feb/2023:20:50:13 +0000] "-" 408 - "-" "-
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15] WARNING: [pool www] child 185, script '/workspace/login.php' (request: "GET /login.php") execution timed out (37.714901 sec), terminating
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15] WARNING: [pool www] child 183, script '/workspace/admin/index.php' (request: "GET /admin/index.php") execution timed out (37.715245 sec), terminating
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15] WARNING: [pool www] child 185 exited on signal 15 (SIGTERM) after 100.209739 seconds from start
[jecnapss] [2023-02-25 20:48:05] Detected 1.0GiB of RAM
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15] WARNING: [pool www] child 183 exited on signal 15 (SIGTERM) after 100.222834 seconds from start
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15 UTC] PHP Notice:  Undefined index: login_name in /workspace/topbar.php on line 23
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15 UTC] PHP Notice:  Undefined index: login_id in /workspace/topbar.php on line 35
[jecnapss] [2023-02-25 20:48:05] PHP memory_limit is 128M Bytes
[jecnapss] [2023-02-25 20:48:05] Starting php-fpm with 8 workers...
[jecnapss] [2023-02-25 20:48:07] Starting httpd...
[jecnapss] [2023-02-25 20:48:08] Application ready for connections on port 8080.
[jecnapss] [2023-02-25 20:49:01] [25-Feb-2023 20:49:01 UTC] PHP Notice:  Undefined index: login_name in /workspace/admin/topbar.php on line 23
[jecnapss] [2023-02-25 20:49:01] [25-Feb-2023 20:49:01 UTC] PHP Notice:  Undefined index: login_id in /workspace/admin/topbar.php on line 36
[jecnapss] [2023-02-25 20:49:01] [25-Feb-2023 20:49:01 UTC] PHP Notice:  Undefined index: system in /workspace/admin/navbar.php on line 7
[jecnapss] [2023-02-25 20:49:01] [25-Feb-2023 20:49:01 UTC] PHP Notice:  Trying to access array offset on value of type null in /workspace/admin/navbar.php on line 7
[jecnapss] [2023-02-25 20:49:01] [25-Feb-2023 20:49:01 UTC] PHP Notice:  Undefined index: login_type in /workspace/admin/navbar.php on line 19
[jecnapss] [2023-02-25 20:49:03] 10.244.21.88 - - [25/Feb/2023:20:49:03 +0000] "-" 408 - "-" "-
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15 UTC] PHP Notice:  Undefined index: login_id in /workspace/index.php on line 227
[jecnapss] [2023-02-25 20:50:15] [Sat Feb 25 20:50:15.423176 2023] [proxy_fcgi:error] [pid 279:tid 140112537061120] [client 10.244.2.105:43608] AH01067: Failed to read FastCGI header
[jecnapss] [2023-02-25 20:50:15] [Sat Feb 25 20:50:15.423560 2023] [proxy_fcgi:error] [pid 279:tid 140112537061120] (104)Connection reset by peer: [client 10.244.2.105:43608] AH01075: Error dispatching request to : 
[jecnapss] [2023-02-25 20:50:15] [Sat Feb 25 20:50:15.423537 2023] [proxy_fcgi:error] [pid 279:tid 140112547546880] [client 10.244.2.105:43596] AH01067: Failed to read FastCGI header
[jecnapss] [2023-02-25 20:50:15] [Sat Feb 25 20:50:15.423802 2023] [proxy_fcgi:error] [pid 279:tid 140112547546880] (104)Connection reset by peer: [client 10.244.2.105:43596] AH01075: Error dispatching request to : 
[jecnapss] [2023-02-25 20:50:15] 10.244.2.105 - - [25/Feb/2023:20:49:37 +0000] "GET /login.php HTTP/1.1" 503 299 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.56
[jecnapss] [2023-02-25 20:50:15] 10.244.2.105 - - [25/Feb/2023:20:49:37 +0000] "GET /admin/ HTTP/1.1" 503 299 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.56
[jecnapss] [2023-02-25 20:50:15] 10.244.2.105 - - [25/Feb/2023:20:49:47 +0000] "GET / HTTP/1.1" 302 11824 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.56

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
February 26, 2023

Hey @floatinglapisraft,

Can you confirm what do you mean by website not working at all, do you see a white screen is your webserivce down or does it keep going down?

First, I noticed that you have 1.0GiB of RAM according to the logs. Try adding some swap to have a failover state when you reach the 1GB of RAM:

https://www.digitalocean.com/community/tutorial_collections/how-to-add-swap-space

What is Swap

Swap is a portion of hard drive storage that has been set aside for the operating system to temporarily store data that it can no longer hold in RAM. This lets you increase the amount of information that your server can keep in its working memory, with some caveats. The swap space on the hard drive will be used mainly when there is no longer sufficient space in RAM to hold in-use application data.

The information written to disk will be significantly slower than information kept in RAM, but the operating system will prefer to keep running application data in memory and use swap for the older data. Overall, having swap space as a fallback for when your system’s RAM is depleted can be a good safety net against out-of-memory exceptions on systems with non-SSD storage available.

#PHP Errors

According to the logs, you have the following errors:

  1. [jecnapss] [2023-02-25 20:48:58] [25-Feb-2023 20:48:57 UTC] PHP Notice: Trying to access array offset on value of type null in /workspace/admin/navbar.php on line 7
  2. [jecnapss] [2023-02-25 20:48:58] [25-Feb-2023 20:48:57 UTC] PHP Notice: Undefined index: login_type in /workspace/admin/navbar.php on line 19

These errors will not necessarily result in a big problem however you might be missing some data from your website. They show that you are trying to access some values that are not there

Configuration Errors

[jecnapss] [2023-02-25 20:50:15] [Sat Feb 25 20:50:15.423176 2023] [proxy_fcgi:error] [pid 279:tid 140112537061120] [client 10.244.2.105:43608] AH01067: Failed to read FastCGI header
[jecnapss] [2023-02-25 20:50:15] [Sat Feb 25 20:50:15.423560 2023] [proxy_fcgi:error] [pid 279:tid 140112537061120] (104)Connection reset by peer: [client 10.244.2.105:43608] AH01075: Error dispatching request to :

These errors point to some issues with your configuration o

More Configuration errors created by your website’s code

These as well:

[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15] WARNING: [pool www] child 185, script '/workspace/login.php' (request: "GET /login.php") execution timed out (37.714901 sec), terminating
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15] WARNING: [pool www] child 183, script '/workspace/admin/index.php' (request: "GET /admin/index.php") execution timed out (37.715245 sec), terminating
[jecnapss] [2023-02-25 20:50:15] [25-Feb-2023 20:50:15] WARNING: [pool www] child 185 exited on signal 15 (SIGTERM) after 100.209739 seconds from start

If you read them closely, it seems your request is timing out, possibly because of your code. You’ll need to further investigate where is this timeout coming from, it should be from somewhere in your code

alexdo
Site Moderator
Site Moderator badge
February 26, 2023

Hello @floatinglapisraft

I believe this can also occur when the droplet is running out of memory. What I can recommend is examining the logs and checking if the droplet is having issues with its RAM.

You can add a swap to the droplet (if not done already)

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04

You can also check which processes are consuming the memory of the droplet using tools like top netstat and others.

https://www.digitalocean.com/community/tutorials/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.