I am trying to set up a PHP server on my localhost to run with the Eclipse PDT.
I want to be able to view the PHP site I am developing on something like http://localhost/MySite/index.php so that I can Run it straight from Eclipse.
I am using IIS 7.5 (windows 7 home premium) for the PHP server.
So far I have followed these instructions, but have not been able to get it to work:
- Install
CGIoption in Windows Features - Install
IIS Managerin Windows Features (so I can runinetmgr.exe) - Download the NTS-version of php and extract the zip to
C:/php - Rename
php.ini-developmenttophp.iniand set theextension_dirvariable - Run
inetmgrand create a new website to run PHP applications (I removed theDefaultSite):- Site Name:
My Site - Physical Directory
C:/dev/MySite - Application Pool:
DefaultAppPool - Bindings:
- Host:
- IP Address:
All Unasigned - Port:
80
- Site Name:
- In
inetmgr: Click on handler mappings and add a newModule Mapping:- Request Path:
*.php - Module:
FastCGIModule - Executable:
C:/php/php-cgi.exe
- Request Path:
Now I have many problems:
-
In
IIS Manager, when I clickEdit Site>Test Settings, there is a yellow exclamation-mark warning:Authorization: Cannot verify access to path (C:/dev/MySite):The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again.
-
When I try to load any
.phpfile directly from the webroot (C:/dev/MySite) it displays as plain-text in my web browser -
When I try to
Runmy project in Eclipse, it goes tohttp://localhost/MySite/index.phpand there is a404 Error: Website Not Found -
When I go to
http://localhost/in my web browser, I also get a404 Error.
I’m afraid I don’t have an answer to you’re question, but I wanted to share…
I never was a fan of running PHP on IIS or Apache. So I built a portable, no-install-required copy of nginx that I could move around with me or use on my Windows machines. (Just download the flavors of PHP, Nginx, and MySQL you want and start it). One of the reasons is that most production sites run nginx anyway, so this way I’m closer to what my server actually uses (unless you are on “shared-hosting” which still uses the Apache).
Second, I’m not sure why you need to “run” it from Eclipse. When you write PHP you usually are dealing with a lot of variables to get pages setup. I would say you need to worry more about adding Unit Tests to make sure things work right, and using a browser like Firefox (with firebug) for testing any requests you might be making. Things like AJAX, or dealing with session cookies often require more control than what Eclipse can give you.
Bottom line, I’m not sure why you think you need to do this.