New answers tagged php
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_&...
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("...
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 ...
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 ;;
...
Top 50 recent answers are included
Related Tags
php × 975apache-httpd × 209
centos × 147
debian × 116
linux × 111
ubuntu × 71
mysql × 64
nginx × 61
permissions × 54
bash × 52
shell-script × 36
cron × 36
webserver × 35
software-installation × 34
shell × 32
apt × 29
yum × 27
security × 25
php7 × 24
sudo × 22
curl × 22
rhel × 20
package-management × 20
arch-linux × 19
phpmyadmin × 18