As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

1 vote

How to read variables from a php file in bash

Building up on @Poikilos's answer: eval "$( php -r ' require("config.php"); foreach(get_defined_vars() as $name => $var) if (is_string($var)) echo "php_&...
Stéphane Chazelas's user avatar
1 vote

How to read variables from a php file in bash

I suggest that you use the program that will "do one thing well" (Unix philosophy), in this case use PHP to parse PHP. You can do so from bash as follows: variable1=$(php -r 'require("...
Poikilos's user avatar
  • 226
0 votes

PHP was compiled with zlib module, but phpinfo() show it's disabled

Phar zlib support isn't the same as zlib support within PHP. That's all there is too it - phar is a code archive format, and it not having enabled zlib compression support is not an indication of zlib ...
Marcus Müller's user avatar
2 votes
Accepted

Ubuntu - Always use certain php version for certain directory

This is a quick and dirty wrapper function you can use in a shell like sh or bash: php () ( case "$PWD/" in /var/www/company/ ) c=php8.1 ;; * ) c=php ;; ...
Kamil Maciorowski's user avatar

Top 50 recent answers are included