Problem setting of PhpStorm for PHP, help please!

I've been using PhpStorm only for client side development until now, now I need php and can't get this set up.
I have apache set up locally and php tested and working. I changed apache config to point to my PhpStorm project folder as server root.
I added some php code to my .html files, and changed the extension to .php,
However now the "preview in browser" has been disabled in the menu, and I can't see my php pages.
I tried setting up a run configuration, however for "PHP Web Application" it needs a server which I don't have,
I tried the "PHP Built-in Web Server" but it gives me this error "Failed to listen on localhost:80 (reason: An attempt was made to access a socket in a way forbidden by its access permissions."
So how am I supposed to get this working, any help is greatly appreciated
Thanks

1 comment

Hi there,

I changed apache config to point to my PhpStorm project folder

and

however for "PHP Web Application" it needs a server which I don't have

These two sentences contradict each other. Apache is a web server -- so you do have one.


However now the "preview in browser" has been disabled in the menu, and I can't see my php pages.

To have this option enabled you have to have Deployment entry properly configured AND marked as Default (Settings | Deployment) -- "In place" type should be fine since Apache website root is already ointing there.


I tried the "PHP Built-in Web Server" but it gives me this error "Failed to listen on localhost:80 (reason: An attempt was made to access a socket in a way forbidden by its access permissions."

http://php.net/manual/en/features.commandline.webserver.php

Since you already have an Apache running on port 80 ... there is no surprise that built-in one fails to start on the same port.




As I understand you do not know how to conigure your Apache so it can serve PHP files? If so -- have a look at some of these artciles, maybe you will find your answers there:

0

Please sign in to leave a comment.