R
R
Roman Basharin2015-01-17 18:42:04
PHP
Roman Basharin, 2015-01-17 18:42:04

How to change php local value (nginx, ubuntu)?

Can you please tell me how can I change the php settings for a specific site?
Input data:
Hosting: VDS (timeweb);
System: Ubuntu;
Web server: Nginx;
PHP version: 5.5.9;
There are several sites, I want to change some Local Values ​​for individual folders (root directories of the site). Tried through .htaccess - doesn't work (it's kind of like for Apache only :D ?). The maximum that I could find was to write in the /etc/nginx/conf.d/mySite.conf file:
location / {
fastcgi_param asp_tags "on";
}
ps Asp-tags used just to check if there are changes or not.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Basharin, 2016-10-12
@Hellek

For those who are interested. Approximately in this directory /usr/local/php7/etc/php-fpm.d
Created a file with the following content

; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[поддомен.myDomain.ru]

user = www-data
group = www-data

listen = 127.0.0.1:ANOTHER_PORT

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

chdir = /

php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]$pool
php_admin_value[error_log] = /var/www/dir1/dir2/temp/errors.log
php_admin_value[mail.log] = /var/www/dir1/dir2/temp/mail.log
php_admin_value[open_basedir]      = /var/www/dir1/:.
php_admin_value[upload_tmp_dir]    = /var/www/dir1/dir2/temp
php_admin_value[session.save_path] = /var/www/dir1/dir2/temp/sessions
php_admin_value[session.gc_probability] = '1'
php_admin_value[session.gc_divisor] = '10'
php_admin_value[session.cookie_domain] = 'поддомен.myDomain.ru'

In general, this way you can configure php "for a specific" domain / subdomain. Where ANOTHER_PORT is specified, you need to specify a port other than the standard one (9007) and in the nginx settings (/etc/nginx/conf.d) in front of "fastcgi_pass" specify just this port (in place of asterisks) -127.0.0.1:*** ;

I
IPv4, 2015-01-18
@IPv4

I can only advise you to install several versions of PHP on the server and specify the required version with the necessary parameters for each site.
With php-fcgi, you can specify your path to the interpreter for the site.
First link from google.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question