Q: Adjusting of php.ini I know that it is possible to set parameters in php.ini like this:
error_log = "%sprogdir%/userdata/logs/%phpdriver%_error.log"

How can I properly run php using command line and set these parameters? Similarly:
php -c path/to/php/ini [here something like this: %sprogdir%=path1 %phpdriver%=path2] 


A: Are you looking to be able to export a parameter to environment variables using PHP? If so, the exec command may be what you're looking for: PHP: exec - Manual.
You'd execute something similar to this I believe:
<?php
    echo exec('export phpdriver=value');
?>


EDIT: Due to misunderstanding of the question.
To correctly answer the question, we are going to create a script to set some environment variables before executing some PHP from the command line. 
Here is our example shell - php_runner.sh
#!/bin/bash
export progsdir=$1
export phpdriver=$2
php -c path/to/php/ini

Once this is created (remember to set correct permissions as well), we can execute it from command line as such:
/path/to/php_runner.sh path1 path2 

