Running PHP file outside of documentroot (cgi-bin folder)

后端 未结 5 1432
慢半拍i
慢半拍i 2021-01-25 13:22

I am working with a colleague to set up their local environment on a MAC in XAMPP, on windows my vhost looks like the one below.

When I access a URL like http://domain.l

5条回答
  •  心在旅途
    2021-01-25 14:04

    Do you know whether PHP is running as a CGI program or as a webserver module? You should be able to find this out if you can get a phpinfo() page working (maybe from a regular folder inside the website root). If you're running as a webserver module then you should have a section near the top with a heading of Server API which says Apache 2.0 Handler (or equivalent).

    From these pages:

    • https://bugs.php.net/bug.php?id=13316
    • http://php.net/manual/en/install.unix.commandline.php
    • http://gallery.menalto.com/node/8955

    ... it seems that it may be either due to PHP running as a CGI script, or else a conflict between PHP and another CGI handler.

    One of the posters on the third linked page found that their similar-sounding end of script headers issue was resolved by removing / commenting out the Options +ExecCGI line in their .htconfig / vhosts file.

    Might be worth having a read through the above links to see if your problem is related.

提交回复
热议问题