Re: trouble moving existing site that has "self-contained" Pear packages defined within own directories
| From: | Markus Ernst | Date: | Thu, 29 Mar 2007 08:40:39 +0000 |
| Subject: | Re: trouble moving existing site that has "self-contained" Pear packages defined within own directories | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26939@lists.php.net to get a copy of this message | ||
l Burnerheimerton schrieb:
I am moving an existing app written years ago to a new server. It uses Sigma Template 1.3 and Quickform 1.1.1 and PEAR.php,v 1.1.1.1 2004/02/16 The directory structure is like this: /site /site/html/Pear.php /site/html/Sigma.php /site/html/Common.php /site/html/Quickform.php /site/html/Quickform/ /site/Mail/mail.php /pages/page1.php .... In the file Quickform.php, it starts off with: ini_set('include_path','.:..'); .... (line 23)require_once('PEAR.php'); (line 24)require_once('HTML/Common.php'); require_once '../HTML/Sigma.php'; ....Are you sure the original HTML directory name was "html" (in lowercase), while the require_once statement called "HTML" in uppercase? I assumed that path names were case sensitive; I am not sure about it anyway. But harmonizing this would not do any harm for sure.
This throws the error: Warning: main(HTML/Common.php) [function.main]: failed to open stream: No such file or directory in C:\...\HTML\QuickForm.php on line 24 If I change: (line 24)require_once('HTML/Common.php'); to (line 24)require_once('Common.php'); it throws MANY more errors but the first of which is: Warning: defaultrenderer(HTML/QuickForm/Renderer/Default.php) [function.defaultrenderer]: failed to open stream: No such file or directory in C:\..\HTML\QuickForm.php on line 1416 which is where the default renderer is referenced using 'HTML/QuickForm/Renderer/Default.php' I want to move this site over with as little change as possible and still work without updating it too much because updating one thing is going to make me change many things. I am wondering if I shouldn't set up an Apache.conf alias for HTML to that directory for that virtual host. Any ideas or experience in moving an existing site sites where all the pear packages are self-contained, is MUCH appreciated!!If you still have access to the old server, it might be useful to check possible include_path settings at all levels. If not, try to compare the original PEAR directory structure with the one at your server, and add include_paths, such as: $incPath = $_SERVER['DOCUMENT_ROOT'].'/site'; $incPath .= ':'.$incPath.'/HTML; ini_set('include_path', $incPath.':'.ini_get('include_path')); This will find PEAR.php in /site/HTML/, and also HTML/Common.php in /site/; and as you append the original include path, the rest of your application will not be affected. Of course you will have to delete all appearances of ini_set('include_path','.:..') and such, as this overrides your include_path settings. As I am not too familiar with server settings and related stuff, I am not sure whether this is the ultimate advice for you, but it might point a direction where to go on thinking... Also if you use older versions of PEAR, you might run into other errors related to server settings, PHP version, safe-mode and so on. If you are familiar with CVS, you might consider using it for finding differences in your PEAR packages compared to their originals. HTH Markus