Recopy PHP.ini on subservers


So at one point in setting up a new server, I deleted my /etc/php.ini (or it got moved or something, not quite sure) but anyways it wasn’t there. I then went ahead and created all my virtual servers. Now it appears that since no /etc/php.ini file existed, that there is none in /home//etc/php.ini. I’ve since managed to recopy back (I think that’s my issue, I copied it because I had one php.ini in a virtual server I must have created before the other /etc one was deleted/moved, and I believe Virtualmin changes some lines in the ini file (like session save path for example).

My question is, is it at all possible (via command line even) to recopy and apply whatever changes virtualmin does, the php.ini in /etc to the virtual servers again? Else I’ll settle for copying the file by hand but I’ll still be at a loss for the lines that need changing.

My system is CentOS 6.5 x64 running latest virtualmin version.

I did use the instructions in this document ( to install php 5.4 as one sub server I have needed something less then php 5.5. (Oh, I compiled php and apache+suexec to be newest version available)

Thanks in advanced!


Anyone? Any ideas at all please?


The two lines that are changed are the session save path, and the file tmp upload path, both are set to the tmp directory in the sites’s home directory.

You can also see what is changed by creating a new dummy site and using diff to see what is changed

diff /etc/php.ini /home/dummy/etc/php.ini


Jamie tells me that one way to re-copy the php.ini file would be to change the PHP Execution Mode to something else, then change it back. You could do that from within the GUI, or using the command line.

To do that from the command line, you could run “virtualmin modify-web”, and then pass in the “–mode” parameter.



Going back over my old threads and realized I never responded to this one. My apologizes. Thank you both for your answers! I cannot believe I didn’t think of the diff command at the time. Changing the mode worked a charm from what I can remember.