Re: php4 and php5 on windows
| From: | Greg Beaver | Date: | Sun, 24 Oct 2004 03:53:58 +0000 |
| Subject: | Re: php4 and php5 on windows | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34043@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Hi, Maybe I am a bit dense but I am trying to do the following: I have php4 installed into c:\php and php5 installed into c:\php5. Now I want to install PEAR in the php5 dir. When I click on go-pear.bat it doesnt seem to run the php.exe from the php5 dir. Even if I manually fix the cli path during the install I end up with a PEAR install in the php5 dir for php4. The "pear -V" command also indicates that it is using the php4 CLI. I dont quite get what is going on though since the bat script seems to be using the php.exe in local dir or path and calling php.exe in the php5 dir works just fine.This may be due to using the environment variables you have already set up for where PEAR's php binary exists. go-pear is a real pain if you already have another PEAR installation. In my case, it always overwrites my existing pear.ini without asking. These are problems that should be addressed. I had several thoughts about this and other windows issues tonight while watching a show in Brooklyn (hmmm, no comment about the show...) Basically, I think pear.ini should default to dirname(__FILE__) . '\\pear.ini' on windows, and only if it doesn't exist should it look for the one in winnt/windows. In addition, I think we can make pearcmd.php run out of the box on windows - no go-pear needed. This would bring a large number of php users to PEAR who have been constantly complaining on pear-general about how hard it is to install PEAR (and it is pretty hard to do it right). Unix folks can still install PEAR the way it does now, as it always has worked very well on unix. Details of my idea involve something like so: // move this here require_once 'PEAR/Config.php'; $config = &PEAR_Config::singleton(); if ('@include_path@' == '@'.'include-path'.'@') {
if (substr(PHP_OS, 0, 3) == 'WIN') {
if (file_exists(dirname(__FILE__) . '\\pear.ini') {
$config->readConfigFile(dirname(__FILE__) . '\\pear.ini');
} elseif (!$config->getFile('user') && !$config->getFile('system')) {
$config->set('php_dir', dirname(__FILE__) . '\\pear');
$config->set('data_dir', dirname(__FILE__) . '\\peardata');
$config->set('doc_dir', dirname(__FILE__) . '\\peardocs');
$config->set('tests_dir', dirname(__FILE__) . '\\peartests');
$config->set('scripts_dir', dirname(dirname(__FILE__)));
if (file_exists(dirname(dirname(__FILE__)) . '\\cli\\php.exe') {
$config->set('php_bin', dirname(dirname(__FILE__)) . '\\cli\\php.exe');
} else {
$config->set('php_bin', dirname(dirname(__FILE__)) . '\\php.exe');
}
}
}
} else {
ini_set('include_path', '@include_path@');
}
// and the later code would now be:
if ($pear_user_config) {
$config->readConfigFile($pear_user_config, 'user');} if ($pear_system_config) {
$config->readConfigFile($pear_system_config, 'system');} This default configuration would satisfy many users and allow basic installation/uninstallation tasks. Advanced users would simply know how to set things up once it's up and running. In general, I would like it to search for pear.ini in getcwd(), dirname(__FILE__), and then in system-wide locations, in that order. Greg