Master need your help about centos5 install php5.2 and php5.3 together.

.::Gsmdenis::.

Verified User
Joined
Jun 15, 2007
Messages
123
Due customer needed, so i try to install 2 php versions on server. but have some questions. i hope all master help , thanks in advance.


  • php version: 5.2.17 and 5.3.28
  • install as : 5.2.17 CGI and 5.3.28 CLI
  • PHP 5.2 (default)
  • PHP 5.3 (htaccess)


Step:

cd /usr/local/directadmin/custombuild
./build set custombuild 1.2
./build update
mkdir -p custom/ap2
cp -pf configure/ap2/configure.php5 custom/ap2/configure.php6
perl -pi -e 's/php53/phprep/' versions.txt
perl -pi -e 's/php6/php53/' versions.txt
perl -pi -e 's/phprep/php6/' versions.txt
./build set php5_ver 5.2
./build set php6_cgi no
./build set php6_cli yes
./build set php5_cgi yes
./build set php5_cli no
./build php n
mv -f /usr/local/php6 /usr/local/php6_old
ln -s /usr/local/php5 /usr/local/php6

php install logs:

php-5.3.28
.......
Make Complete
Copying php.ini..
cp: cannot stat `php.ini-dist': No such file or directory
Increasing memory limit to 20M...
Can't open /usr/local/lib/php.ini: No such file or directory.
Can't open /usr/local/lib/php.ini: No such file or directory.
Disabling magic_quotes_gpc...
Can't open /usr/local/lib/php.ini: No such file or directory.
Can't open /usr/local/lib/php.ini: No such file or directory.
Installing php...
Installing PHP SAPI module: apache2handler
/var/www/build/instdso.sh SH_LIBTOOL='/var/www/build/libtool' libphp5.la /usr/lib/apache
/var/www/build/libtool --mode=install cp libphp5.la /usr/lib/apache/
cp .libs/libphp5.so /usr/lib/apache/libphp5.so
cp .libs/libphp5.lai /usr/lib/apache/libphp5.la
libtool: install: warning: remember to run `libtool --finish /usr/local/directadmin/custombuild/php-5.3.28/libs'
chmod 755 /usr/lib/apache/libphp5.so
[activating module `php5' in /etc/httpd/conf/httpd.conf]
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/man/man1/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.3.11
[PEAR] Console_Getopt - already installed: 1.3.1
[PEAR] PEAR - already installed: 1.9.4
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] Structures_Graph- already installed: 1.0.4
[PEAR] XML_Util - already installed: 1.2.1
/usr/local/directadmin/custombuild/php-5.3.28/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar
Installing PDO headers: /usr/local/include/php/ext/pdo/
PHP 5.3.28 Installed.

PHP-5.2.17

Build complete.
Don't forget to run 'make test'.

Make Complete
Copying php.ini..
/usr/local/etc/php5/cgi/php.ini already exists, skipping.
Increasing memory limit to 32M...
Installing php...
Installing PHP SAPI module: cgi
Installing PHP CGI binary: /usr/local/php5/bin/
Installing PHP CLI binary: /usr/local/php5/bin/
Installing PHP CLI man page: /usr/local/php5/man/man1/
Installing build environment: /usr/local/php5/lib/php/build/
Installing header files: /usr/local/php5/include/php/
Installing helper programs: /usr/local/php5/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php5/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.3.11
[PEAR] Console_Getopt - already installed: 1.3.1
[PEAR] Structures_Graph- already installed: 1.0.4
[PEAR] XML_Util - already installed: 1.2.1
[PEAR] PEAR - already installed: 1.9.4
Wrote PEAR system config file at: /usr/local/php5/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
Installing PDO headers: /usr/local/php5/include/php/ext/pdo/
PHP 5.2.17 with suPHP Installed.
Writing data to /etc/httpd/conf/extra/httpd-suphp.conf
Done.
Rewriting all users httpd.conf files, please wait...
Debug mode. Level 10

dataskq: command: action=rewrite&value=httpd
Restarting apache.
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

Back to check PHP -v

[root@host custombuild]# php -v
PHP 5.3.28 (cli) (built: Jan 12 2014 19:56:45)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

[root@host custombuild]# /usr/local/php5/bin/php -v
PHP 5.2.17 (cli) (built: Jan 12 2014 20:00:36)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

[root@host custombuild]# /usr/local/php6/bin/php -v
PHP 5.2.17 (cli) (built: Jan 12 2014 20:00:36)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies


My question is :

  • Which code in .htaccess file if customer need php5.3x ?
  • And above steps all correct ? if have any mistake, please correct me , thanks



Best regards !

Happy new year to all friend to help around !

Denis
 
Last edited:
hi ,

Thanks for your reply, i don't want to using this plug (Due to install this plug before on server, which not work for me, when i press PHP Version Selector on user lever, which just loading , and final give me a blank page, so i did uninstalled), i just wanna to know my step above if 100% correct. thanks
 
Last edited:
Since you can "call" both PHP version i suppose your steps are correct.

Dont know the .htaccess code, but that plugin did work well for me and it handle the .htacces needed code.

Regards
 
Since you can "call" both PHP version i suppose your steps are correct.

Dont know the .htaccess code, but that plugin did work well for me and it handle the .htacces needed code.

Regards

Thanks for your help , hmmm, yes, i tested this plugin 2 times, but did not work, sometime show me blank page, and sometime show me domain not found.

Final, i install as 5.2.17 CLI and 5.3.28 CGI, but did not success as 5.2.17 CGI and 5.3.28 CLI, Very strange.

Best regards!

Denis
 
Back
Top