会不会和之前那个 RewriteRule 写成这样有关?
RewriteRule ^(.*)$ /restful/index.php?/$1 [L]
下面是 $_SERVER里面的东西
Array ( [PATH] => /sbin:/bin:/usr/sbin:/usr/bin [SCRIPT_NAME] => /restful/index.php [REQUEST_URI] => /restful/articles [QUERY_STRING] => /articles [REQUEST_METHOD] => GET [SERVER_PROTOCOL] => HTTP/1.1 [GATEWAY_INTERFACE] => CGI/1.1 [REDIRECT_QUERY_STRING] => /articles [REDIRECT_URL] => /restful/articles [REMOTE_PORT] => 55634 [SCRIPT_FILENAME] => /web/restful/index.php [SERVER_ADMIN] => you@example.com [CONTEXT_DOCUMENT_ROOT] => /web [CONTEXT_PREFIX] => [REQUEST_SCHEME] => http [DOCUMENT_ROOT] => /web [REMOTE_ADDR] => 192.168.33.1 [SERVER_PORT] => 80 [SERVER_ADDR] => 192.168.33.10 [SERVER_NAME] => api.com [SERVER_SOFTWARE] => Apache/2.4.25 (Unix) mod_fcgid/2.3.9 [SERVER_SIGNATURE] => [HTTP_ACCEPT_LANGUAGE] => zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4 [HTTP_ACCEPT_ENCODING] => gzip, deflate, sdch [HTTP_ACCEPT] => */* [CONTENT_TYPE] => multipart/form-data [HTTP_USER_AGENT] => Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 [HTTP_CACHE_CONTROL] => no-cache [HTTP_POSTMAN_TOKEN] => 6b837694-964d-bf4c-6d13-2008d7af5c66 [HTTP_CONNECTION] => close [HTTP_HOST] => api.com [REDIRECT_STATUS] => 200 [FCGI_ROLE] => RESPONDER [PHP_SELF] => /restful/index.php [REQUEST_TIME_FLOAT] => 1491920639.0935 [REQUEST_TIME] => 1491920639 )
你的PHP运行模式不是 apache2handler 所以没有,fastcgi方式运行的PHP需要另外配置,建议改为apache2handler方式运行。这样改造度最小
同问怎么将php的运行模式改为apache2handler方式
请问怎么将php 的运行模式改为apache2handler方式