可以在Linux/Unix 服务器上设置 PHP 以 CGI 方式运行吗

Windows servers "always" run PHP as a CGI app, so this FAQ may not apply to Windows hosts.

Things to Note when Running PHP as CGI

Installation Tips for Installing Zen Cart when server is running PHP as CGI

Quick installation tips:
  • upload all the files as-is ... do NOT change any permissions settings (contrary to regular installation instructions)Quick installation tips:
  • do the regular install (ie: zc_install)
  • now set the configure.php files to 444 permissions (read-only, as per installation instructions) (THIS LIKELY HAS TO BE DONE VIA YOUR HOSTING CONTROL PANEL, not by FTP)
  • most other permissions issues should already be handled just fine

Tips for Server Administrators running PHP as CGI

You may have to change some of the parameters for CGI scripts when it's running in that mode or else you will get "500 Internal Server Error" messages in your browser:

Suggested settings adjustments:
  • You may have to change some of the parameters for CGI scripts when it's running in that mode or else you will get "500 Internal Server Error" messages in your browser:
  • Process timeout 10 seconds (any longer and the Error 500's cause some real havoc on the server.)

There may be slight performance increases running as CGI, but again that depends on configuration, and if you can't configure it correctly, you'll end up with errors instead of performance benefits.

Having Problems?

If you are having problems on a server which runs PHP as CGI, and your hosting account doesn't give you access to configuring the PHP-as-CGI settings, then you' might be better off finding a hosting configuration where PHP is running as an Apache Module instead.