Answer the question
In order to leave comments, you need to log in
nginx routing. php7.0-fpm and php7.3-fpm on the same host?
There is a YII framework for which all requests to the web server are processed by one index.php file.
The task was to add api to the project without a third-party host. Those. when accessing the same domain /api/(parameters)*,
for example, run another version of php with a different www folder.
How to implement it?
Fragment of nginx config
location ~ \.php {
client_max_body_size 8m;
client_body_buffer_size 128k;
fastcgi_split_path_info ^(.+\.php)(.*)$;
set $fsn /index.php;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
#fastcgi_param REQUEST_URI $request_url;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question