Quickly view PHP’s memory_limit values for all virtual servers

Quickly view PHP’s memory_limit values for all virtual servers

When one needs to quickly check the individual PHP memory_limit value for a long list of virtual servers (presumably hosted by Virtualmin), going from folder to folder and reading the contents of the etc/php.ini file is one (loooooong) way of doing things.

Fortunately, there’s an easier way, with the help of a bit of bash scripting.

for acc in `ls /home/`;
   do echo "$fn: ";
   cat /home/$acc/etc/php.ini | grep memory_limit;
done

will list all memory_limit lines for each folder (presumably also a virtual server) in the home directory.

Leave a Reply