search
HomeBackend DevelopmentPHP TutorialPHP5.5在IIS7.5上无法运行,改用5.3版本后正常

部门有个前端工程师要在IIS下部署PHP,给装了一个PHP5.5.14,结果部署完成后,打开页面一直提示500错误:发生未知 FastCGI 错误

网上搜索半天,有的说是没装PHP5.5.14用到的VC11运行时,于是去这里下载并安装,问题依旧


继续搜索,说是 PHP5.5开始,已不支持xp和win2003上运行了,只支持Win7以上系统,可是哥这就是Win7啊,一筹莫展啊。
后来尝试双击运行c:\php5.5.14\php-cgi.exe,结果弹出提示“c:\php5.5.14\php-cgi.exe 不是有效的Win32应用程序”,用这个去搜索,也是说“此为版本问题,PHP5.5版本 最低要运行于操作系统版本号最低要6.0”,这不扯吗?我的WIN7是6.1版本啊啊啊

后面抱着试一试的想法,下载了一个PHP5.3.5版本,首先双击php-cgi.exe,确认是可以执行,不会报错,然后修改IIS里的程序映射,指向这个5.3.5的cgi,果然php顺利运行了起来。

后记:谁再跟我说PHP5.5.14只支持WIN7以上,我跟谁急


注:我的PHP安装步骤如下:

1、去这里下载一个ZIP包,解压PHP到C:\php5.5.14,并修改文件名,把php.ini-development改名为php.ini;

2、修改php.ini里的配置,找到如下配置节,逐一修改(注:有些配置是我这边需要的环境):

extension_dir = "ext"fastcgi.impersonate = 1extension=php_curl.dllextension=php_mbstring.dllextension=php_mysql.dlldate.timezone = "Asia/Shanghai"
3、给Win7安装IIS,并注意要选中安装CGI
      进入控制面板,找到并打开“程序与功能”,点击窗口左侧的“打开或关闭Windows功能,勾选”Internet信息服务“:

4、配置PHP,

        a、开始=》运行,输入inetmgr,打开”Internet信息服务管理器“,并打开右侧的”处理程序映射“:

        b、打开右侧的”添加模块映射“,添加php扩展名,并映射php目录下的php-cgi.exe程序:

到这一步,如果没有意外,PHP就配置完成了,可以在网站根目录下添加一个a.php文件,内容如下:

<?phpphpinfo ();
然后打开浏览器访问: http://127.0.0.1/a.php,正常会显示php的相关信息


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What is the difference between absolute and idle session timeouts?What is the difference between absolute and idle session timeouts?May 03, 2025 am 12:21 AM

Absolute session timeout starts at the time of session creation, while an idle session timeout starts at the time of user's no operation. Absolute session timeout is suitable for scenarios where strict control of the session life cycle is required, such as financial applications; idle session timeout is suitable for applications that want users to keep their session active for a long time, such as social media.

What steps would you take if sessions aren't working on your server?What steps would you take if sessions aren't working on your server?May 03, 2025 am 12:19 AM

The server session failure can be solved through the following steps: 1. Check the server configuration to ensure that the session is set correctly. 2. Verify client cookies, confirm that the browser supports it and send it correctly. 3. Check session storage services, such as Redis, to ensure that they are running normally. 4. Review the application code to ensure the correct session logic. Through these steps, conversation problems can be effectively diagnosed and repaired and user experience can be improved.

What is the significance of the session_start() function?What is the significance of the session_start() function?May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

What is the importance of setting the httponly flag for session cookies?What is the importance of setting the httponly flag for session cookies?May 03, 2025 am 12:10 AM

Setting the httponly flag is crucial for session cookies because it can effectively prevent XSS attacks and protect user session information. Specifically, 1) the httponly flag prevents JavaScript from accessing cookies, 2) the flag can be set through setcookies and make_response in PHP and Flask, 3) Although it cannot be prevented from all attacks, it should be part of the overall security policy.

What problem do PHP sessions solve in web development?What problem do PHP sessions solve in web development?May 03, 2025 am 12:02 AM

PHPsessionssolvetheproblemofmaintainingstateacrossmultipleHTTPrequestsbystoringdataontheserverandassociatingitwithauniquesessionID.1)Theystoredataserver-side,typicallyinfilesordatabases,anduseasessionIDstoredinacookietoretrievedata.2)Sessionsenhances

What data can be stored in a PHP session?What data can be stored in a PHP session?May 02, 2025 am 12:17 AM

PHPsessionscanstorestrings,numbers,arrays,andobjects.1.Strings:textdatalikeusernames.2.Numbers:integersorfloatsforcounters.3.Arrays:listslikeshoppingcarts.4.Objects:complexstructuresthatareserialized.

How do you start a PHP session?How do you start a PHP session?May 02, 2025 am 12:16 AM

TostartaPHPsession,usesession_start()atthescript'sbeginning.1)Placeitbeforeanyoutputtosetthesessioncookie.2)Usesessionsforuserdatalikeloginstatusorshoppingcarts.3)RegeneratesessionIDstopreventfixationattacks.4)Considerusingadatabaseforsessionstoragei

What is session regeneration, and how does it improve security?What is session regeneration, and how does it improve security?May 02, 2025 am 12:15 AM

Session regeneration refers to generating a new session ID and invalidating the old ID when the user performs sensitive operations in case of session fixed attacks. The implementation steps include: 1. Detect sensitive operations, 2. Generate new session ID, 3. Destroy old session ID, 4. Update user-side session information.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment