note 113242 added to configuration

From: Date: Tue, 17 Sep 2013 10:30:46 +0000
Subject: note 113242 added to configuration
Groups: php.notes 
Request: Send a blank email to php-notes+get-196276@lists.php.net to get a copy of this message
To run separate apache and php processes on centos (at least) without having to compile and install separate versions for every instance this should work: Install apache and php with yum. This will give you (for the first instance): /etc/httpd/*, /etc/sysconfig/httpd, /etc/init.d/httpd, /etc/php.ini and /etc/php.d/*. Copy all this stuff to: /etc/httpd2/*, /etc/sysconfig/httpd2, /etc/init.d/httpd2, /etc/php2.ini and /etc/php2.d/*. Then: Edit the apache config files in /etc/httpd2/* to reflect the new ports you want to have this apache listen on (don't forget ssl.conf under conf.d) and any other differing settings, like log file destinations and virtualhosts. Edit the php2.ini for any specific settings you want the other php instance to have. To have a completely separate php in this new apache instance with its own modules included, edit /etc/sysconfig/httpd2 and add the following: PHPRC=/etc/php2.ini export PHPRC PHP_INI_SCAN_DIR=/etc/php2.d export PHP_INI_SCAN_DIR This will set the environment variables for the second apache/php instance before it is started. Then edit /etc/init.d/httpd2 and change all references to httpd (like lockfile, pidfile and sysconfig) to httpd2. Don't touch the executable name, though :) And change this: LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS to this: LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd -f /etc/httpd2/conf/httpd.conf $OPTIONS .. so this apache can find its own configuration file. Then, if necessary 'chkconfig --add /etc/init.d/httpd2' to have it in startup and you should have two apache instances with two separate php modules with their own dedicated settings. ---- Server IP: 69.147.83.199 Probable Submitter: 84.107.79.153 ---- Manual Page -- http://php.net/manual/en/configuration.php Edit -- https://master.php.net/note/edit/113242 Del: integrated -- https://master.php.net/note/delete/113242/integrated Del: useless -- https://master.php.net/note/delete/113242/useless Del: bad code -- https://master.php.net/note/delete/113242/bad+code Del: spam -- https://master.php.net/note/delete/113242/spam Del: non-english -- https://master.php.net/note/delete/113242/non-english Del: in docs -- https://master.php.net/note/delete/113242/in+docs Del: other reasons-- https://master.php.net/note/delete/113242 Reject -- https://master.php.net/note/reject/113242 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196276) next »