Ubuntu 12.04 - Built-in web server on PhpStorm 7 not functional (fastcgi error)
Hello,
Am new to PhpStorm (running Ubuntu 12.04) and could some guidance on how to setup the built in webserver. I clicked on the icon for Chrome that appears on the right side of the file and came up with following error:
502 Bad Gateway
address: http://localhost:63342/Symfony/src/KK/DemoBundle/Controller/PageController.php
I then proceeded to configured the PHP interpreter selected the PHP language level: Php 5.5, Interpreter: PHP 5.5.8 and did not include anything in the Include path section.
I re-run the Chrome icon and the same error appears and this time I get a php-cgi not found error (Please ensure that configured PHP Interpeter build as CGI program (--enable-fastcgi was specified) in PhpStorm.
I've googled this to no avail for this particular error. Can someone please help me set this up?
-------------------------
Ok I've checked out the short tutorial at http://confluence.jetbrains.com/display/PhpStorm/Using+the+Built-in+Webserver+in+PhpStorm, and everything seems to be setup as instructed.
Yet, when I go to http://localhost:63342/Symfony/web/app_dev.php (Symfony is the directory name) I get the 502 Bad Gateway error.
请先登录再写评论。
Hi there,
I'm not Symfony user ... but I think that this "502 Bad Gateway error" can be generated by Symfony itself -- as a security measure as you shoud not request framework individual files directly.
I'm not sure if Symfony can be run on PhpStorm's own built in *simple* web server as it does not support .htaccess / URL routing (AFAIK everything in Symfony goes through single index.php).
To confirm that -- just create simple new project (with one or two files) and try there. If I'm correct then it will work there.
Thanks for the reply. I tried the following:
1) I ran the test project and selected the built-in server on the right side icon and came up with the same 502 Bad Gateway error, exactly as mentioned in the pervious post with an error message with fastcgi.
2) I tried to make a test folder/index.php and I got a 404 Not Found error. (http://localhost:63342/debug/index.php) <-- This was just plugging into the URL in Chrome.
I am running my projects from /var/www/ is there a way to set this in PhpStorm ? Where is localhost:63342 root located?
Nowhere.
The URL must look like this: localhost:63342/PROJECT_NAME/index.php . PhpStorm will serve files based on the PROJECT_NAME.
So if your project is in "/var/www/123" folder, then URL should be "localhost:63342/123/index.php" (assuming that you have not renamed the project. If you did -- then it should contain project name instead of folder name).
OK. I did some additional search .. and it sounds like your PHP was not compiled with "--enable-fastcgi" (or "--disable-cgi") parameter specified (FastCGI is required by built-in web server).
Unfortunately I'm on Windows (where it is already compiled that way) and cannot verify this info myself. Can you please check output of your phpinfo(); (or "php -i" in console) -- check "Configure Command" field on the very beginning.
Right, I created a test folder and ran it the same way came up with the same error regarding the fastcgi.
I checked my phpinfo() and .ini file and didn't see any option regarding enabling fastcgi.
I can't be the only person running PhpStorm and Ubuntu 12.04 with this problem. :/
No other ideas unfortunately.
http://youtrack.jetbrains.com/issue/WI-17365#comment=27-560871
Cheers mate, submitted a ticket earlier today haven't heard back yet. Thanks for looking into this.
Fixed!
For anyone that may across this, installed the fastcgi mod here and reinstalled apache2.
https://launchpad.net/~ondrej/+archive/apache2?field.series_filter=precise