2

I'm using FastCGI with suEXEC for PHP on CentOS 7. My wrapper script looks as follows:

#!/bin/sh
PHPRC=/home/ben/etc/
export PHPRC
export TMPDIR=/home/ben/tmp/
exec /usr/bin/php-cgi -c /home/ben/etc/php.ini

The PHPRC variable is set and phpinfo shows it but the custom php.ini will not be used. Phpinfo just says:

Configuration File (php.ini) Path   /etc
Loaded Configuration File   (none)

Does anyone know how to fix this?

Dave M
  • 4,514
  • 22
  • 31
  • 30
Fynn
  • 21
  • 1

1 Answers1

0

In my fast-cgi wrappers it is configured like:

#!/bin/bash
PHPRC=$PWD/../etc/php7.2
export PHPRC
umask 022
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php-cgi

So your PHPRC should do the trick. No need for the -c /home/.../php.ini parameter.

Is /home/ben/etc/php.ini file readable for the fast-cgi user (probably ben)?

B. Walger
  • 33
  • 1
  • 4