Two php versions (5.3.x and 5.4.x)

indexs

Verified User
Joined
Jun 11, 2010
Messages
74
Hello everyone!

I need a advice from DA community.
I want to have two php versions on my server php 5.3.x and 5.4.x

At the moment I have this options.conf:

PHP:
#PHP settings.
#Default version of PHP is always php1_release. Possible values for php1/php2_release: 5.3, 5.4, 5.5, no. php1/php2_mode: mod_php, fastcgi, php-fpm or suphp)
default_php=php1_release

php1_release=5.3
#php2_release=5.4

#php1_mode=mod_php
php1_mode=mod_php
#php2_mode=suphp

htscanner=yes
php_ini=yes
php_timezone=EET
#Possible values - production or development
php_ini_type=production
ioncube=yes
x-mail-header=yes
#zend=yes
zend=no


#HTTP server. Possible values: apache, nginx, nginx_apache
webserver=apache

#Apache settings
#Possible value: 2.4
apache_ver=2.4
mod_ruid2=yes
#mod_ruid2=no
secure_htaccess=no
harden-symlinks-patch=yes
use_hostname_for_alias=auto
redirect_host=rock1.host.com
redirect_host_https=no


#Possible values - 5.1, 5.5, 5.6
mysql=5.6
mysql_inst=no
mysql_backup=yes
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups

#Web applications
phpmyadmin=yes
phpmyadmin_ver=4
squirrelmail=no
roundcube=yes

#Mail options
exim=yes
eximconf=yes
clamav=yes
spamassassin=yes
dovecot=yes
pigeonhole=no

#Statistics
awstats=no
webalizer=yes

#FTP options - possible values: proftpd, pureftpd
ftpd=proftpd
#ftpd=pureftpd

#Jailed shell
jail=no

#Autoconf/automake/libtool options
autoconf=yes
automake=yes
libtool=yes
curl=yes

#versions of zlib, apr_util and libxml2 (experts only)
zlib=no
new_zlib=no
new_xml2=yes
new_pcre=no
new_suphp=no
old_apr_util=no

#Custombuild options
custombuild=2.0
autover=no
bold=yes
clean=yes
cleanapache=no
clean_old_tarballs=yes
clean_old_webapps=yes
downloadserver=files6.directadmin.com

#Cron settings
cron=no
cron_frequency=daily
[email protected]
notifications=yes
da_autoupdate=no
updates=no
webapps_updates=yes

#Cloudlinux settings
cloudlinux=no
cagefs=no
harden_symlinks_patch=yes
x_mail_header=yes
pureftpd_uploadscan=no
proftpd_uploadscan=no
clamav_exim=yes
apache_mpm=auto
opcache=no
suhosin=no
suhosin_php_uploadscan=no
mysql_force_compile=no
php2_release=no
php2_mode=php-fpm
modsecurity=no
modsecurity_ruleset=comodo
dovecot_conf=yes
eximconf_release=2.1
blockcracking=no
easy_spam_fighter=no
webapps_inbox_prefix=yes
modsecurity_uploadscan=no
litespeed_serialno=trial
mariadb=10.0
sa_update=no

Could anyone give me advice to run two PHP, the php5.3 should run mod_ruid2.
 
Last edited:
Code:
cd /usr/local/directadmin/custombuild
./build set php2_release 5.4
./build set php2_mode suphp
./build php n
 
Thank you.

I have set:
./build set php2_release 5.4
./build set php2_mode suphp

After run command:
./build update
./build versions

and got this message:
"WARNING: It's not recommended to use apache with mod_ruid2 & suPHP enabled. It's a redundant and slow combination."
 
It's only a warning. If your requirement is to have mod_ruid2 installed, there is no other way to have 2 PHP versions. The slowness is slight and affects only the 2nd version of PHP.
 
I`ll give it a shot and try to setup second php.
I hope i`m not braking anything.
 
php5.3 and php5.4 seems to be installed.

Only thing I`m facing now is that i need to add man ually to virtual host:
Code:
<FilesMatch "\.php$">
AddHandler x-httpd-php54 .php
</FilesMatch>
<FilesMatch \.php53$>
AddHandler x-httpd-php53 .php53
</FilesMatch>

Should I run any command to reconfigure setting/options for each virtual host?
Otherwise when I change the php version in DA my added code is gone.
 
I think i have a clue what i need to change.
In directory: /usr/local/directadmin/data/templates
I need to change?
1) virtual_host2.conf
or
2) virtual_host.conf

What I need to edit to make it work, so I don`t need to edit any users virtualhost manually?
 
Just some advise to think about:
I want to have two php versions on my server php 5.3.x and 5.4.x
Isn't it better to use 5.4 and 5.5 for example? Because 5.3 and 5.4 are both are declared not only end of life but also end of support, which means there will be no more updates and/or security fixes for either 5.3 and 5.4.
 
Just some advise to think about:

Isn't it better to use 5.4 and 5.5 for example? Because 5.3 and 5.4 are both are declared not only end of life but also end of support, which means there will be no more updates and/or security fixes for either 5.3 and 5.4.

That is a good point!
Thank you!
 
About:
Code:
<FilesMatch "\.php$">
AddHandler x-httpd-php54 .php
</FilesMatch>
<FilesMatch \.php53$>
AddHandler x-httpd-php53 .php53
</FilesMatch>

Was the thing with custom templates for: virtual_host2.conf
In directory: /usr/local/directadmin/data/templates/custom

I have removed it and run command: ./build rewrite_confs

And now everything works fine, just need to run some random tests to be sure.

Thank you for great support!
 
Back
Top