Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archiving via cron with custom php executable and php.ini file #9113

Open
hannesbochmann opened this issue Oct 28, 2015 · 3 comments
Open

Archiving via cron with custom php executable and php.ini file #9113

hannesbochmann opened this issue Oct 28, 2015 · 3 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@hannesbochmann
Copy link

There are several issues for me with the archiving via cron when I have a custom php executable and a custom php.ini file.

First of all the console uses hardcoded the php executable found in the PATH variable through the shebang in the console script. I can workaround this with the following call:

hash /usr/local/software/php/5.5.15/bin/php php && /usr/local/software/php/5.5.15/bin/php -c .../my_custom_php.ini .../piwik/console core:archive ...
So instead of using the system wide php binary the same php executable is used which is used to invoke the console (as long as the path to the custom php executable is the same as the one set with "hash /usr/local/software/php/5.5.15/bin/php php") including all passed parameters like a custom .ini file.

But the parameter "-c" is not passed to the forked php process done by CLI archiving. I think this should be done by the CliPhp class which returns the path to the PHP binary. Arguments for the php executable should be added there.

I have this problem as the json extension is not installed system wide but only through my custom ini file which results in an error as piwik has the wrong ini file.

I hope the problem description is understandable.

@hannesbochmann
Copy link
Author

Setting "export PHP_INI_SCAN_DIR=/var/www/fcgi-bin.d/tegut.com-213_174_33_110-80/" before calling the archiving seems to help neither.

@tsteur
Copy link
Member

tsteur commented Oct 28, 2015

We're most likely taking the PPH version defined in the constant PHP_BINARY. This should be the PHP binary path of the current script execution. The -c option is a good point, we should actually indeed forward this option, maybe not all options though (I'm not sure we'd probably just have to read over several options) 👍

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Oct 28, 2015
@mattab
Copy link
Member

mattab commented Dec 23, 2015

Related to #9258 - forwarding parameters to CLI scripts
and maybe also related to #8771

@mattab mattab added this to the Short term milestone Dec 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants