Running PHP in IIS6 - php

i am using IIS to run my php website and i configure IIS to work with php as its explained the following tutorial
http://www.wikihow.com/Install-PHP-5-for-IIS-6
but when i run any php page is give me the following error
You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
i follow this https://serverfault.com/questions/251499/error-when-installing-php5-on-iis6/252149#252149
now i am getting the following error message
FastCGI Error
The FastCGI Handler was unable to process the request.
Error Details:
Could not find entry for "php" on site 67761686 in [Types] section.
Error Number: 1413 (0x80070585).
Error Description: Invalid index.
HTTP Error 500 - Server Error.
Internet Information Services (IIS)
here is my updated fcgiext.ini
[Types]
php=PHP
[PHP]
ExePath=C:\PHP\php-cgi.exe
now i am getting this error message
The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------
Error Details:
The FastCGI process exceeded configured request timeout
Error Number: 258 (0x80070102).
Error Description: The wait operation timed out.

I hope this link would help
http://www.ardamis.com/2009/02/15/php-pages-return-a-404-error-on-iis/
Open iis.msc again, go back to the Home Directory tab, and select the “Scripts only” option >from the Execute Permissions menu. Restart the server.
The server should now be correctly processing .php files.

PHP pages return a 404 error on IIS
I was installing PHP 5 on an IIS 6 server when I ran into what turns out to be a pretty common problem. PHP appeared to be installed correctly, but browsing to any page with a .php extension returned a 404 Page Not Found error. While the steps below fixed this for me, I had to piece them together from a few different sources, and a number of other suggestions (like copying the php.ini file to C:/WINDOWS/) didn’t work and were not necessary.
Open your IIS management console at C:\WINDOWS\system32\inetsrv\iis.msc.
Drill down to your web site, right-click and select Properties.
Select the Home Directory tab, then click on the Configuration button.
Select the Mappings tab.
If you don’t see a .php extension listed, click the Add button. Browse to the PHP 5 DLL (which may be at C:\Program Files\PHP\php5isapi.dll). Type .php into the Extension field and leave everything else at the default values. Click OK. The extension and executable path will be filled out and under Verbs you should see “All”.
I should point out that I didn’t have anything listed under the ISAPI Filters tab.
Stop and restart your IIS server and browse to a .php file. (To restart your IIS server, open the IIS management console, right-click the local computer in the left pane, hover on All Tasks and choose Restart IIS.) Chances are, you’re no longer getting the 404 error, but are now seeing a 403.1 message, like:
The page cannot be displayed
You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
Please try the following:
* Contact the Web site administrator if you believe this directory should allow execute access.
HTTP Error 403.1 – Forbidden: Execute access is denied.
Internet Information Services (IIS)
Open iis.msc again, go back to the Home Directory tab, and select the “Scripts only” option from the Execute Permissions menu. Restart the server.
The server should now be correctly processing .php files.

Take a look at my answer on Server Fault for a fairly bulletproof way to install PHP in under ten minutes:
Error When Installing PHP5 on IIS6
If you follow all of the steps in the correct order you'll have PHP up and running in no time.
Updated:
As per your comment and question update, edit your fcgiext.ini file so that it only contains the following lines:
[Types]
php=PHP
[PHP]
ExePath=C:\PHP\php-cgi.exe

Execute the following from the command prompt:
1.
cd c:\Windows\system32\inetsrv
2.
c:\Windows\system32\inetsrv>cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"c:\php\php-cgi.exe"

Related

FASTCGI process has failed frequently recently. Try the request again in a while

We have setup a Wordpress Website on IIS 10 which was working fine. But suddenly it stops working and i got this error
"FASTCGI process has failed frequently recently. Try the request again
in a while"
Restarting IIS fixed this problem.
Anybody tell me why this issue has occurred and how we can fix this ?
Thanks
Open command prompt as administrator and navigate to the php-cgi.exe
folder.
Execute any PHP file from your application to know the exact error. In my case, I created a simple phpinfo.php page and executed
following command.
C:\Program Files (x86)\PHP\v7.4.5>php-cgi.exe E:\Websites\mysite\phpinfo.php
It showed me the exact error saying 'vcruntime140.dll is not
compatible with this PHP build' & I have updated to 'Microsoft Visual C++ Redistributable for Visual Studio 2019'. You can download it from here.
Once you identified and resolved the error(point 3), you need to restart IIS server and run your website. It will work as expected.
If you're running PHP 8 turn track_errors Off in php.ini . Track_errors have been deprecated since 7.2 and can cause a fatal error in IIS
Finally, i found the solution to the issue, It is due to the low value given to "Rapid Fails PerMinute" - see above image posted by German Martin.
From Microsoft's website the default value for "Rapid Fails PerMinute" is 90 but i reduced it 10 and then the error "FASTCGI process has failed frequently recently...." started showing up.
Once i set it back to the default value of 90 , the error stopped. This is what worked for me, in my case.
You need to maximize "Instance MaxRequest" at FASTCGI Configuration. Just clic en IIS root -> FastCGI Settings, select you php-cgi.exe for WP and clic Edit. Then increise Instance MaxRequests
[IIS FastCGI Settings]

PHP script running in XAMPP and not working in IIS 8.5

I have a problematic PHP script.
The script is working fine in XAMPP but I need it in IIS 8.5 and there are several errors (some of them I've managed to handle).
I've tested on same Win Server 2012 R2 and if script is in C:/Xampp/htdocs/ProjectFolder/send.php and I run it at localhost:88/ProjectFolder/send.php (XAMPP is on port 88) is working fine. If same script that is now C:/inetput/wwwroot/ProjectFolder/send.php and I run it at localhost:80/ProjectFolder/send.php (IIS is on port 80) is not working.
The script is here (PHP script)
When run the script in IIS, this is first error:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Full screen of error here (First error in IIS)
I added 2 Handlers in IIS, at server level: Handler Mappings-->Add Module Mapping
- first handler request path is *.html and module FastCgiModule, with executable php-cgi (see image html handler ) and Request Restrictions (Mapping Invoke Handler unchecked - see image Mapping tab, Verbs all verbs - see image Verbs tab, and Access None - see image Access tab)
- second - same for php (see image - html and php Handlers added)
I run the script again (after IIS restart) and I got following error:
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Error 2 - see image Second error in IIS I cannot handle
Here I got stacked. Please advice. Thank you very much!

Cannot Start Wamp Server

For some unknown reason I cannot start WAMP server - The icon stays yellow no matter what:
Checked port 80, and it's not used.
No Skype, no Firewall.
Tried MANY solutions I suggested here in stackoverflow - absolutely nothing.
Tried to uninstall and reinstall - it worked for 10 minutes, then it didn't work again.
The only thing I'm changing is to include Virtual Hosts under httpd.conf. Checked every solution I could find on the net - nothing is working for me.
Maybe, just maybe it's because I previously installed PHP 5.5 apart from WAMP? If I go to PHP > PHP Extensions > then I can see there's a problem in php_opcache and php_enchant. When I click on them I get an error message that says: Could not execute menu item (internal error). [Execption] Could not perform service action: the service has not been started. The PHP Version I installed is 5.5.15. The PHP WAMP is 5.5.12... I don't have a clue how to uninstall PHP, and I couldn't find anything about that on the net.
PHP Error log says: PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - %1 is not a valid Win32 application. in Unknown on line 0
EDIT - It seems like the cause for the problem is me trying to include Virtual Host via httpd.conf file. When I excluded, like in default, WAMP is online again. Any suggestion of how to include virtual host and still get WAMP get online?
It looks like you're running on a corrupt install have you tried reinstalling the software?
Alternatively i would recommend using Xampp which basically offers the same service as Wampp only with a bit more ease of access (also allowing for Mecury mail service and an FTP server for remote access).
The problem with php_intl can be corrected easily, see this answer
In order to find out what Apache is complaining about with the Virtual Hosts definition look at the Windows Event Log or, launch a command window and
cd \wamp\bin\apache\apachex.y.z\bin
httpd -t
This should give you filename and line number where your errors are.
Try changing that port number anyway. Mine stays yellow if the port number is set to 80, even though WAMP says it's not being used by any other program.

HTTP Error 500.0 - Internal Server Error on wordpress

am new here - I have been having problems with this $%%$%$ IIS7.5 I have finished developing a wordpress site on my localhost using xampp - so I thought this was gonna be business as usual just copy files to remote- change config and dump sql - boy was I wrong! I think I have done everything I know to do and am still getting this annoying HTTP Error 500.0 - Internal Server Error
This is what I get each time,When I am trying to access the site:
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Detailed Error Information
Module
FastCgiModule
Notification
ExecuteRequestHandler
Handler
PHP_via_FastCGI
Error Code
0x00000000
Requested URL
http://mysite.com:80/index.php
Physical Path
E:\HostingSpaces\xxxxxxxxx\mysite.com\wwwroot\index.php
Logon Method
Anonymous
Logon User
Anonymous
Most likely causes: •IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
•IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
•IIS was not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL.
•The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try: •Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
•Check the event logs to see if any additional information was logged.
•Verify the permissions for the DLL.
•Install the .NET Extensibility feature if the request is mapped to a managed handler.
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Links and More Information This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
View more information »
Microsoft Knowledge Base Articles:
•294807
Please can anyone just tell me precisely what to do,I cant take it anymore.. please help me.
So my case is hopeless - i cant be helped?
IIS server is not equal to Apache. It uses another type of configs. I think your problem in the web.config file or related to permissions. Your question isn't so subjective. You need to localize problem and describe here more detailed information. Now your question looks like this: "I have PHP application on IIS that doesn't work. I tested it on my xampp. Where is problem?". There are a lot of problems that you can have here...
I has same problem with php 5.6 on iis 6 (windows server 2012 r2)
You should ensure the VC++11 runtime is installed (for me it's Visual C++ Redistributable for Visual Studio 2012 Update 4)
It's probably because the connection string mismatch,check your connection string.
"500 - Internal server error" error message when a user tries to access your Apache or Lighttpd based dynamic php application
Generally, to solve this problem you need to take help of log files located at following location:
=> /var/log/message
=> /var/log/httpd/error_logs (/var/log/lighttpd/error_log or /var/log/httpd/error_log)
This error only occurs because of web server software. However after looking through logs you may not find many details. This problem may be caused by:
A malformed php cgi script
An invalid directive in an .htaccess or other config file
Limitation imposed by file system and server software (for example php log file size set to 10Mb)
Missing php.ini (or cannot read php.ini file)

Php error on localhost. Error 403

I am currently getting an error with php using XAMPP. The error is:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
I have no changes made to the config of XAMPP and was unable to find away to fix this. I have read about the error and tried suggested fixs, none of which work for me or others that tried them.
A bit more info on this, it only happens after clicking a submit button ().
Any suggestions on how to fix this would be very much appricated
PHP is probably not running. i once had this problem with apache2 php5 and apache-php5-mod(from my package repository) on linux.
I could only serve plain html(no php) files untill i fixed it.
Does a simple php_info() file work?
Is the page with the submit button a .php or a .html?
If the phpinfo file fails try making a simple php info and running it from the command line(without the apache server)
(to do this):
1. open windows explorer.
2. navigate to php.exe
3. in the address bar, enter "C:\WINDOWS\system32\cmd.exe" (a window should open.)
4. in the window type "php.exe PATH_TO_PHPINFO_FILE\FILENAME.php"
Please tell me what it outputs.

Categories