Do settings in a particular site (virtual server) php.ini override the settings in the Virtualmin installation php.ini? Or are they just a limit on what is available from the installation to that particular virtual server?
Example: Virtualmin, Webmin-> Others->PHP Configuration-> Resource Limits-> Maximum Memory Allocation = 128mb
Virtual Server: Virtualmin, mysite.com, Services->PHP Configuration-> Resource Limits -> Maximum Memory Allocation = 256mb
How much memory would be available to php at mysite.com? I am guessing 128mb, Virtualmin overrides the site. Is that right? if the numbers were reversed in the above example, I believe the answer would still be 128MB. So to get mysite more memory, both would have to be 256mb?
Next Level: If mysite runs a cronjob on the Virtualmin Installation, is the memory available to php for that cronjob controlled by mysite.com or Virtualmin?
I am guessing for cronjobs the memory is controlled by Virtualmin.
What command could I run at the command level to see the answers?
If you’re using FCGID or CGI for that particular domain, which is the default, than that domain’s php.ini file is used for all PHP configuration.
In your example above, that means 256MB.
You could make changes to that config either in $HOME/etc/php.ini, or in Virtualmin using what you described above, Services->PHP Configuration – both of those are editing the same file.
To use the system-wide php.ini file, you could switch the domain to use mod_php… but we don’t recommend that for security reasons
To see what the values look like for your website, you could create a file named test.php, and for it’s contents, add the following into it:
<?php phpinfo(); ?>
And then access that in your browser… that will show you the PHP config variables being used.
Regarding the cron job – that’s a trickier question. It depends on how the cron job is being run
Do you have an example of how the cron job looks?
(you could also edit some or all domain php.ini files using a shell script, calling the command line functions)
Thanks for the help. I tried the list command from the Virtualmin interface:
virtualmin list-php-ini --domain name | --user name | --all-domains [–php-version number] <–ini-name name>+ <–ini-value value>+ [–name-only]
and when I list a domain name on the installation, I get unknown command. Please can you tell me what I am doing wrong?
Thanks for the help. I tried the test.php file. It worked great. I can see that my site has 256MB memory available to it.
For the chronjob memory question, I am running a plugin in one of my WordPress sites:
I’ve received notices the chronjob failed to finish due to a lack of memory, so I was trying to figure out what controls the memory available to run this job.
Okay, that makes sense then… try changing that command to look like this:
PHPRC=/home/mysite.com/etc/php5/ /usr/bin/php /home/mysite.com/public_html/wp-content/plugins/nameofplugin/grab_ads.php
And see if that does the trick for you.