petejkim/autoparts

php cli seems to load ini in wrong locations

dqminh opened this issue · 3 comments

Using these commands:

strace -o strace.log php --version
grep php.ini strace.log

it shows that php cli is loading ext from:

open("/home/action/.parts/etc/php5/php.ini/php-cli.ini", O_RDONLY) = -1 ENOTDIR (Not a di                           
rectory)                                                                                                            
open("/home/action/.parts/packages/php5/5.5.11/bin/php.ini", O_RDONLY) = -1 ENOENT (No su                           
ch file or directory)                                                                                               
open("/home/action/.parts/etc/php5/php.ini/php.ini", O_RDONLY) = -1 ENOTDIR (Not a direct                           
ory)

which is very different from the location we tell php to look for config i.e. /home/action/.parts/etc/php5/php.ini

It's using the --with-config-file-path option as a directory so maybe if we changed https://github.com/nitrous-io/autoparts/blob/master/lib/autoparts/packages/php5.rb#L28 to a directory, it'll work (so for web servers, it'd use php.ini, for the CLI it'd use php-cli.ini).

$ php --ini                                                                                                                          
Configuration File (php.ini) Path: /home/action/.parts/etc/php5/php.ini                                                                                                            
Loaded Configuration File:         (none)                                                                                                                                          
Scan for additional .ini files in: (none)                                                                                                                                          
Additional .ini files parsed:      (none)

Updating this compile option with the folder hardcoded works for Phalcon Devtools, and PHP works as well. Should I update the PHP5.rb part in a PR to the following?

"--with-config-file-path=/home/action/.parts/etc/php5/",

Added PR #112 .