Probably this would solve your problem ..
sudo apt-get install php5-cgi
-happy coding :)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I am trying out PHPStorm and cannot open my site in my browser from PHPStorm. When I try, the page that opens says:
502 Bad Gateway
and in PHPStorm, a notification says:
php-cgi not found
Please ensure that configured PHP Interpreter built as CGI program (--enable-fastcgi was specified)
I didn’t know what this meant so I contacted PHPStorm support and they told me to navigate to the PHP installation folder and update my configuration by running --enable-fastcgi.
I suppose I should instead do --enable-cgi because according to the docs --enable-fastcgi no longer exists.
But I like to know a bit about what I’m doing before running commands in the command line, and I saw the following warning from here:
"A server deployed in CGI mode is open to several possible vulnerabilities. Please read our CGI security section to learn how to defend yourself from such attacks."
This link looks overwhelming and I don't know what it's talking about, so could someone please confirm if it is safe for me to follow the instructions from support and run the command?
And what is the PHP installation folder? I am using Laravel Homestead. Would I simply ssh into the homestead directory and type --enable-cgi?
Please or to participate in this conversation.