Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 4
PEAR Upgrade problem: How to change the document root location? 
 
Ross
Guru
 
Avatar
Total Posts:  336
Joined:  2007-08-31
Scarborough, North Yorkshire, UK
 

How can I reset the document root value that PEAR seems to remember?

I had set up a Magento installation on one machine, and then migrated it to another machine.  Everything seemed to be working great until I tried the PEAR upgrade today.

As the document root had changed (no longer /srv/www/htdocs), I got this error on the PEAR upgrade screen:

ERRORfailed to mkdir /srv/www/htdocs/lib/Zend/Acl/Assert
ERROR
failed to mkdir /srv/www/htdocs/lib/Varien/Convert/Action
ERROR
failed to mkdir /srv/www/htdocs/app
ERROR
failed to mkdir /srv/www/htdocs/skin/install/default/default/css
ERROR
failed to mkdir /srv/www/htdocs/skin/adminhtml/default/default/images/tree_icons
ERROR
failed to mkdir /srv/www/htdocs/skin/frontend/default/default/css

...basically, it is just trying to put the files in the wrong location (but the right location for the original installation).

I tried to find a setting for this, but couldn’t see any in the database.  Looking through the file system the path seemed to be saved in hundreds of places!!

Is there an easy way to change the path, or do I have to search and replace it in hundreds of locations?

Thanks for any suggestions!

Image Attachments
Magento Admin_1202986311262.pngfile-system-grep.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Ross
Guru
 
Avatar
Total Posts:  336
Joined:  2007-08-31
Scarborough, North Yorkshire, UK
 

Under magento/lib/pear there is a shell script called ‘clean’, don’t run it as it cleans out a bit too much smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ross
Guru
 
Avatar
Total Posts:  336
Joined:  2007-08-31
Scarborough, North Yorkshire, UK
 

Ok, I think I found out what to do.

delete the old pear.ini
magento/lib/pear/pear.ini

Now, in doing this we loose the old directory settings, but also loose the ‘stable’ or ‘beta’ upgrade options, so resave the PEAR configuration via the Magento backend.
Go to: System -> Extensions -> PEAR Configuration
set: Preferred State to ‘Beta’ (or whateva)
Save PEAR Config

Then the PEAR upgrade should work (of course your mileage may vary).

 
Magento Community Magento Community
Magento Community
Magento Community
 
finch8243
Sr. Member
 
Total Posts:  79
Joined:  2007-08-31
 

As of today (July 15 2008, version 1.1 beta) looks like pear.ini is located in magento/downloader/pearlib/pear.ini

 
Magento Community Magento Community
Magento Community
Magento Community
 
piccaya
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2008-10-07
Brussels
 

Hi everybody,

I had a similar issue installing a new module. It kept on trying to install it on the same server but different folder…
Follow the steps and you’ll get it done.

magento/downloader/pearlib/pear.ini

Delete the file - don’t try to edit it - it doesn’t work.

(Based on a Magento 1.17 config)

piccaya

 
Magento Community Magento Community
Magento Community
Magento Community
 
SimpleHelixcom
Enthusiast
 
Avatar
Total Posts:  906
Joined:  2007-08-31
Huntsville, AL
 

although this works, note that deleting pear.ini, it will also remove all user’s extensions

perhaps there has to be a better method than this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Florent
Jr. Member
 
Total Posts:  16
Joined:  2008-09-15
 

I had the same issue, and I just modified various paths in the pear.ini file.
As it is a serialized php variable, I also had to change the “number” before path to match my own path length.

 
Magento Community Magento Community
Magento Community
Magento Community
 
SeL_
Magento Team
 
Avatar
Total Posts:  1140
Joined:  2007-10-10
Paris, France
 

Thanks Florent for your tip, it’s very useful.

There is only one file to update : downloader/pearlib/pear.ini
Change the paths to the new ones and update the value before with the path string length.

For example, my path changed from /home/mag/ to /home/mag2/
Everywhere i find something like this :

s:28:"/home/mag/downloader/pearlib"
(between 2 semi columns)
i changed to this :
s:29:"/home/mag2/downloader/pearlib"

I changed 28 to 29 because there is 1 more character in the string.

HTH.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jon Edwards
Jr. Member
 
Total Posts:  29
Joined:  2008-10-10
 

@SeL

Is this really the only way to fix this problem? This is more than just a simple find/replace. It’s easy enough to open pear.ini in a text editor, replace “/old/path” with “/new/path” but the path length variable is different for each of these occurrences. So I have to go through and count characters for each of these paths?!

My paths got all screwed up because I had been working on one “production” server online and realized I needed a “development” platform set up locally for testing etc. SO I exported the DB via the backup utility and tar/zipped the files, moved everything to my local machine, imported database, copied files, etc. I was aware that I needed to change my base_url values in the DB table core_config_data, but now this!  Of course this pear.ini file has all of the paths for the “production” site. 

I just upgraded my local 1.1.8 to 1.2.0.2 using Magento Connect Manager and all seemed to work fine. But like so many others, the admin area still showed 1.1.8 and none of the new features worked, so I discovered my issue with the Pear.ini file.

I’ll fix this manually if I have to, hoping I don’t screw up my character counts, by my bigger question for all of you Magento pros, is there a good way to sync two installations of magento without running into all of these hidden issues?  What I want to do seems like a pretty common goal - production and development environments with the ability to update the prod environment when you’re happy with the dev (which requires first a copy of the current prod to the dev)?  Then there is the issue of new orders that have come in on the prod server between updates. I don’t want get this thread sidetracked - I started a new thread about this prod/dev challenge here: http://www.magentocommerce.com/boards/viewthread/28548/ I would love some of the Magento folks to shed some light on these challenges.

Thanks for your help!

Jon

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Weird. our installation was initially in site.com/magento/ We then changed it to just be http://www.site.com/ However, now when I use either Magento Connect or SSH to upgrade it installs the upgrade into the site.com/magento directory.

I have tried renaming pear.ini so it remade a new one but to no avail. Is there any other config file in Magento which may be telling Magento where to install the upgrades?

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Another quick update on this. My pear.ini file shows the entries like this

s:12:"./app/design"

Magento is running in the root of the domain now (it used to be site.com/magento) so surely how it is above now is correct? Or should it be with a ‘/app/design’ instead ‘./app/design’

Thanks for any help with this people.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jon Edwards
Jr. Member
 
Total Posts:  29
Joined:  2008-10-10
 

@benfrain.com

I think your problem is with your path.  ./app/design is going to look in the current directory of the pear.ini file for the folder app/design. So in other words it would be looking at /your_web_root_dir/downloader/pearlib/app/design. Make sense?  “./” means “current directory” where “/” (without the .) means “server root directory”

If you’re on a linux server, your path will look something more like “/home/your_account/public_html/app/design (of course this depends on your server config, but that is the default path often on linux servers running apache) To determine this for sure, login via ssh, go to the web root folder (where you see the magento directories like “app”, “skin”, “media” etc. Then type “pwd” THis will print the current working directory. That is your web root directory that needs to proceed /app/design (in your example) in the pear.ini.  Then make sure you accurately count the number of characters in each of those paths and set the preceding number to that.

Pain in the butt I know.

Let me know if you have questions.

Jon

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Hi Jon, many thanks for that detailed reply. I’m getting a fatal error coming up at the minute but I think there may be a permissions issue. I’m going to 777 everything briefly and try again through Magento Connect and will then update. Thanks for taking the time.

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

OK, I tried the permissions but it isn’t that. With the revised pear.ini file as per your instructions (copied below) I get this eror:

Fatal error: Call to undefined method PEAR_Error::set() in /home/website/domains/website.com/public_html/downloader/Maged/Pear.php on line 105

If I switch the pear.ini back to the old one I don’t get the error but obviously get the problem of the wrong updates. Any further suggestions? Incidentally, line 105 of Pear.php reads…

$config->set('auto_discover'1);

Here is the revised pear.ini

#PEAR_Config 0.9
a:24:{s:10:"__channels";a:2:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}}s:7:"bin_dir";s:67:"/home/website/domains/website.com/public_html/downloader/pearlib";s:7:"doc_dir";s:72:"/home/website/domains/website.com/public_html/downloader/pearlib/docs";s:7:"ext_dir";s:71:"/home/website/domains/website.com/public_html/downloader/pearlib/ext";s:7:"php_dir";s:71:"/home/website/domains/website.com/public_html/downloader/pearlib/php";s:9:"cache_dir";s:73:"/home/website/domains/website.com/public_html/downloader/pearlib/cache";s:8:"data_dir";s:72:"/home/website/domains/website.com/public_html/downloader/pearlib/data";s:12:"download_dir";s:76:"/home/website/domains/website.com/public_html/downloader/pearlib/download";s:8:"temp_dir";s:72:"/home/website/domains/website.com/public_html/downloader/pearlib/temp";s:8:"test_dir";s:73:"/home/website/domains/website.com/public_html/downloader/pearlib/tests";s:8:"mage_dir";s:1:".";s:12:"mage_web_dir";s:1:".";s:12:"mage_etc_dir";s:56:"/home/website/domains/website.com/public_html/app/etc";s:13:"mage_core_dir";s:62:"/home/website/domains/website.com/public_html/app/code/core";s:18:"mage_community_dir";s:67:"/home/website/domains/website.com/public_html/app/code/community";s:14:"mage_local_dir";s:63:"/home/website/domains/website.com/public_html/app/code/local";s:15:"mage_design_dir";s:59:"/home/website/domains/website.com/public_html/app/design";s:12:"mage_lib_dir";s:52:"/home/website/domains/website.com/public_html/lib";s:14:"mage_media_dir";s:54:"/home/website/domains/website.com/public_html/media";s:13:"mage_test_dir";s:54:"/home/website/domains/website.com/public_html/tests";s:13:"mage_skin_dir";s:53:"/home/website/domains/website.com/public_html/skin";s:15:"mage_locale_dir";s:59:"/home/website/domains/website.com/public_html/app/locale";s:15:"preferred_state";s:4:"beta";s:9:"cache_ttl";i:60;}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Jon Edwards
Jr. Member
 
Total Posts:  29
Joined:  2008-10-10
 

Did you change the s:values the precede each path?  It doesn’t look like you did. For example, on lines 1 and 2 above, for “bin_dir” you have s:67 This should be s:64 You have to count the characters of the path the follows the s:value - so in this case the bath to bin_dir is /home/website/domains/website.com/public_html/downloader/pearlib which is 64 characters long, not 67.  Fix these numbers - double check them - and you should be good to go.

Jon

 
Magento Community Magento Community
Magento Community
Magento Community
 
benfrain.com
Sr. Member
 
Total Posts:  142
Joined:  2008-08-15
 

Hi Jon, sorry, I have made that appear wrong as I have substituted the actual website name with ‘website’ in the code above so the character counts will be wrong. However, after checking I was one digit out! Here is the code with a relevant substitute, character number wise. Am I counting right here??

#PEAR_Config 0.9
a:24:{s:10:"__channels";a:2:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}}s:7:"bin_dir";s:66:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib";s:7:"doc_dir";s:71:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/docs";s:7:"ext_dir";s:70:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/ext";s:7:"php_dir";s:70:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/php";s:9:"cache_dir";s:72:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/cache";s:8:"data_dir";s:71:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/data";s:12:"download_dir";s:75:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/download";s:8:"temp_dir";s:71:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/temp";s:8:"test_dir";s:72:"/home/12345678/domains/12345678.com/public_html/downloader/pearlib/tests";s:8:"mage_dir";s:1:".";s:12:"mage_web_dir";s:1:".";s:12:"mage_etc_dir";s:55:"/home/12345678/domains/12345678.com/public_html/app/etc";s:13:"mage_core_dir";s:61:"/home/12345678/domains/12345678.com/public_html/app/code/core";s:18:"mage_community_dir";s:66:"/home/12345678/domains/12345678.com/public_html/app/code/community";s:14:"mage_local_dir";s:61:"/home/12345678/domains/12345678.com/public_html/app/code/local";s:15:"mage_design_dir";s:58:"/home/12345678/domains/12345678.com/public_html/app/design";s:12:"mage_lib_dir";s:51:"/home/12345678/domains/12345678.com/public_html/lib";s:14:"mage_media_dir";s:53:"/home/12345678/domains/12345678.com/public_html/media";s:13:"mage_test_dir";s:53:"/home/12345678/domains/12345678.com/public_html/tests";s:13:"mage_skin_dir";s:52:"/home/12345678/domains/12345678.com/public_html/skin";s:15:"mage_locale_dir";s:58:"/home/12345678/domains/12345678.com/public_html/app/locale";s:15:"preferred_state";s:4:"beta";s:9:"cache_ttl";i:60;}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 4