部门有个前端工程师要在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的相关信息

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.

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.

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

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.

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

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

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

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.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download
The most popular open source editor

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 latest version

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
