devwannabe19
devwannabe19

Reputation: 11

IIS Error when trying to link the php-cgi.exe file to the PHP Manager extension: 'Operation is not valid due to the current state of the object'

I'm trying to configure a web server with IIS which requires PHP for working. I installed the PHP Manager extension on IIS and by default my server has PHP disabled. So I tried to enable PHP and the Manager asks you to input the path of your php-cgi.exe file. So I did it, added the path to the file and when I click 'Ok' for registering PHP and enabling it, it throws this error:

'There was an error while performing this operation.

Details:

Operation is not valid due to the current state of the object.'

It doesn't show any other information about what's causing it. PHP Manager says that my handler mapping is not available, while in other IIS server that I own in a different computer it says 'inherited'. I dont know if handler mappings are related with this error and I need my website to be running PHP for it to work. If I run the server right now it just throws 500 internal server error when trying to access the web. I'm 100% sure its caused by PHP not working because in my other server I also got 500 internal server error because of an incorrect installation of PHP in the server.

EDIT: I forgot to mention that PHP Manager shows that PHP is enabled and working in the server general configuration, but this error I mentioned above happens only on one of the websites of the server.

Upvotes: 1

Views: 2410

Answers (1)

Bruce Zhang
Bruce Zhang

Reputation: 3042

I tried to reproduce the issue but it only reproduce once. Something wrong make register php failed. It can be fixed by register all php again. Please follow these steps.

  1. Click the FastCGI Setting at server level and remove all items which full path points to php-cgi.exe. enter image description here
  2. Click the Handler Mappings at server level and remove all items which path is *.php. enter image description here
  3. Choose the site which you deploy php application. At site level, click the Handler Mapping and click the Revert To Parent.

enter image description here

  1. Click the php manager at server level and register new php version.

Note:IIS only supports versions of php which can be download from Web PI. Please download php from Web PI, not download it from site manually.

Upvotes: 1

Related Questions