As pointed out by @AD7six, I was going about it the wrong way. This is how I solved the issue for anyone else who isn't as familiar with multiple php setups.
Copy the default pool to create our new pool. (You can name the pool whatever you want, in this example I am using www2
):
sudo cp /etc/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/www2.conf
sudo nano /etc/php5/fpm/pool.d/www2.conf
Change the pool name:
[www] => [www2]
Change the listening socket:
listen = /var/run/php5-fpm.sock => /var/run/php5-fpm2.sock
Unfortunately, specifying php.ini files based on pool is impossible. (See this question) But as the answer there states, you can overwrite individual php.ini values. It's not great but as far as I can tell, there's no other way of doing it.
A note for overwriting the php.ini values: There are 4 ways of doing this, php_value, php_flag, php_admin_value, and php_admin_flag. Use the _flag
commands when setting booleans. Use the _value
commands for anything else. The _admin
versions make it so those values/flags cannot be overwritten.
Finally, change your nginx.conf to use the new pool:
fastcgi_pass unix:/var/run/php5-fpm.sock => unix:/var/run/php5-fpm2.sock