Windows Apache 1.3 runs PHP in FastCGI mode

Source: Internet
Author: User
Tags copy ini modify

I have always been running in ISAPI mode Php (as the current mainstream development language) , the biggest disadvantage of this approach is poor stability, when Php Apache The process also died when the error occurred. Later I saw an introduction to the web about Php to Fastcgi (now not many people are using) mode to run The benefits (stability, security, and high performance) that are mentioned have made me decide to try.

But things are not as smooth as expected. Google has not found an article on how to use Apache(Unix platform's most popular Web server platform) + Fastcgi(now not many people are using) to run PHP in Windows( As the current mainstream development language information, IIS(Microsoft's Web server platform) + Fastcgi(now not many people are using) running PHP(as the current mainstream development language) is quite a lot. One of them mentioned Zend company also recommended to Fastcgi(now not many people in use) mode to run PHP(as the current mainstream development language)(http://php(as the current mainstream development language) Lens.com/php (as now the mainstream development language)everywhere/fastcgi(now not many people are using)-php(as the current mainstream development language)).

After several hours of groping, and finally successfully implemented Apache(Unix platform most popular web server platform) 1.3 + Fastcgi(now not many people are using) run PHP(as the current mainstream development language) .

Preparatory work:
First visit to http://www.fastcgi(now not many people are using it). com/dist/downloads mod_fastcgi for Apache(the most popular Web server platform for UNIX platforms) ( Not many people are using it now. I'm using the mod_fastcgi(now not many people are using it)-2.4.2-ap13.dll. After downloading, copy this file to the modules directory of Apache, the most popular Web server platform on UNIX platforms .

Download PHP (as now the mainstream development language)(I use PHP(as the current mainstream development language)-5.0.4), and decompression, as needed to modify PHP(as the current mainstream development language). ini file. Note that you do not need to copy any files to the Windows directory from the directory where PHPis the current mainstream development language .

Modify Configuration:
Then modify the httpd.conf file and add the following lines:

LoadModule fastcgi(not many people are using it now)_module modules/mod_fastcgi(not many people are using it now)-2.4.2-ap13.dll
scriptalias/fcgi(not many people are using it now)-php(as the current mainstream development language)5/"d:/usr/local/php(as the current mainstream development language)-5.0.4/"
Fastcgi(not many people are using it now)Server "d:/usr/local/php(as the current mainstream development language)-5.0.4/php(as the current mainstream development language)-cgi(not many people are using it now). exe "-processes 3
# Description: Here-processes 3 means to start three PHP(as the current mainstream development language)-cgi(not many people are using it now)The. exe process,
# about FASTCGI(not many people are using it now)Please refer to Fastcgi for detailed Server parameters(not many people are using it now)Document.
AddType application/x-httpd-fastphp(as the current mainstream development language)5. php(as the current mainstream development language)
Action application/x-httpd-fastphp(as the current mainstream development language)5 "/fcgi(not many people are using it now)-php(as the current mainstream development language)5/php(as the current mainstream development language)-cgi(not many people are using it now)Exe
# Description: According to your PHP(as the current mainstream development language)The location of the file changes the above two bold words.

After the modifications are complete, restart Apache(the most popular Web server platform on UNIX platforms) .

Problems:
According to my many experiments, the most likely problems are mainly caused by the path. So first check PHP(as the current mainstream development language). ini and httpd.conf files are correct in all the paths. Secondly, if you have previously installed PHP inthe system (as the current mainstream development language), then c:windowsphp(as the current mainstream development language). ini renamed or deleted.

Second, check whether PHP(as the current mainstream development language) file directory has sufficient permissions (I am set to everyone-full control, anyway, the development of the machine do not have to consider so many security restrictions).

Fastcgi(now not many people are using the) mode to run PHP(as the current mainstream development language) advantages:
There are several main benefits to running PHP(as the current mainstream development language) with Fastcgi(now not many people are using it) mode. The first is that PHP (as the current mainstream development language) fails to bring down the Apache(Unix platform's most popular Web server platform), but PHP(as the current mainstream development language) its own process (but Fastcgi(now not many people are using it) will immediately restart a new PHP(as the current mainstream development language) process to replace the lost process. Second Fastcgi(now not many people are using) the mode of running PHP(as the current mainstream development language) than ISAPI mode performance better (I used to use Apache(Unix platform's most popular Web server platform) /c11>bench was tested, but forgot to save the results, and everyone was interested in testing it themselves.

Finally, you can run PHP at the same time(as the current mainstream development language)5 and PHP(as the current mainstream development language)4. Refer to the following configuration file, set up two virtual hosts, one using PHP(as the current mainstream development language)5, the other using PHP(as the current mainstream development language)4.

LoadModule fastcgi(now not many people are using)_module modules/mod_fastcgi(now not many people are using)-2.4.2-ap13.dll

scriptalias/fcgi(now not many people are using)-php(as the current mainstream development language)5/"d:/usr/local/php(as the current mainstream development language)-5.0.4 /"
FASTCGI (now not many people are using)the Server "d:/usr/local/php(as the current mainstream development language)-5.0.4/php(as the current mainstream development language)-cgi (now not many people are using).exe "-processes 3
SCRIPTALIAS/FCGI (now not many people are using)-php(as the current mainstream development language)4/"d:/usr/local/php(as the current mainstream development language)- 4.3.11/"
FASTCGI (now not many people are using)Server "d:/usr/local/php(as the current mainstream development language)-4.3.11/php(as the current mainstream development language) . exe "

Listen 80
Namevirtualhost *:80

DocumentRoot d:/www
Options Indexes followsymlinks MultiViews
ServerName PHP(as the current mainstream development language)5.localhost

AddType application/x-httpd-fastphp(as the current mainstream development language)5. PHP(as the current mainstream development language)
Action application/x-httpd-fastphp(as now the mainstream development language)5 "/fcgi(now not many people are using)-php(as the current mainstream development language)5 /php(as the current mainstream development language)-cgi(now not many people are using).exe "


Indexoptions fancyindexing Foldersfirst
Options Indexes followsymlinks MultiViews
AllowOverride None
Order Allow,deny
Allow from all

Listen 8080
Namevirtualhost *:8080


DocumentRoot d:/www
Options Indexes followsymlinks MultiViews
ServerName PHP(as the current mainstream development language)4.localhost

AddType application/x-httpd-fastphp(as the current mainstream development language)4. PHP(as the current mainstream development language)
Action application/x-httpd-fastphp(as now the mainstream development language)4 "/fcgi(now not many people are using)-php(as the current mainstream development language)4 /php(as the current mainstream development language). exe "



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.