|$/usr/local/bin/php
<?php
$directories = glob('/home/*' , GLOB_ONLYDIR);
$directories = array_map(function($value) {
return basename($value);
}, $directories);
$key = array_search('|USER|', $directories);
switch("|PHP1_RELEASE|"){
case "56" :
$php_port = 30100 + $key;
break;
case "74" :
$php_port = 31000 + $key;
break;
case "81" :
$php_port = 32000 + $key;
break;
case "82" :
$php_port = 33000 + $key;
break;
default :
$php_port = 34000 + $key;
break;
}
echo "set \$PHP_PORT $php_port;";
?>
DONE|
|*if HAVE_PHP1_FPM="1"|
# use fastcgi for all php files
location ~ \.php$
{
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if ( $skip_cache ~ "^$" ) {
set $skip_cache 1;
}
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache FASTCGICACHE;
fastcgi_cache_valid 60m;
include /etc/nginx/nginx_limits.conf;
if (-f $request_filename)
{
fastcgi_pass 127.0.0.1:$PHP_PORT;
}
}
location ~ \.(php53|php54|php55|php56|php70|php71|php72|php73|php74|php80|php81|php82)$
{
deny all;
}
|*endif|