problem with runing multiple php versions on virtualmin


i am new to virtualmin

i am running virtualmin on centos7 which comes with php 5.4. i want also php 5.2 on my server… so i

compile and installed php 5.2 on my server like this:

yum install gcc libxml2-devel bzip2-devel zlib-devel curl-devel libmcrypt-devel libjpeg-devel libpng-devel gd-devel mysql-devel

  1. Compile and install


tar -xjf php-5.2.17.tar.bz2

cd php-5.2.17

./configure --prefix=/usr/local/php52 --with-config-file-path=/etc/php52 --with-config-file-scan-dir=/etc/php52/php.d --with-libdir=lib64 --with-mysql --with-mysqli --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --disable-debug --disable-rpath --with-bz2 --with-curl --with-gettext --with-iconv --with-openssl --with-gd --with-mcrypt --with-pcre-regex --with-zlib

make -j4 > /dev/null

sudo make install

sudo mkdir /etc/php52

sudo cp php.ini-recommended /etc/php52/php.ini

  1. create a fastcgi wrapper script

create file /usr/local/php52/bin/

exec /usr/local/php52/bin/php-cgi
chmod a+x /usr/local/php52/bin/

tutorial from here:

now i created site on virtualmin that site must use php5.2 instead of php5.4 please help me i am new to virtualmin…thanks

sorry for my bad english :frowning:

Virtualmin > Server Configuration > PHP Versions
On the right check the php version you want.
Be sure to recheck the configuration from System Settings - Re-Check Configuration first.

As far as I know the provision in Virtualmin to use multiple versions of PHP requires that the PHP alternate versions be built the same way that they are in the SCL or softwarecollections repositories - that is, they really need to be built specifically to be an ALTERNATE php version, and probably need to be rooted in /opt/rh/ to be recognized by Virtualmin.

And PHP 5.2 ??? how ancient IS this application?

i recheck the config and checked my php versions… it displays this message what i suppose to do now :frowning:
“This virtual server is using the mod_php execution mode for PHP, such does not allow per-directory version selection.”

hi thank u for the help
i search for php5.2 in softwarecollections its not availble they have onlt latest repo :frowning: … please i need to fix this
what i shud do now.

yes 5.2 is too old but i need to intall that for my project :frowning:

as eric said this is the only solution for me :frowning:


Yeah there are ways to get it working, but it’d be a bit tricky with PHP versions not included in the SCL repo.

If you’re going to manually compile it, you could install it into /opt, using a similar directory structure as the SCL repository uses.

Then, Virtualmin will be able to detect it.

Or, when the new Virtualmin version comes out – it will allow you to specify the path for your alternate PHP versions.


thank u eric

i miss the point yes i need to install under /opt .

now i have all versions of php on virtualmin. i followed your comment it helped me

thanks u :slight_smile: