本文介绍了MAMP:如何升级PEAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试升级MAMP pear时,会出现以下错误:

When trying to upgrade MAMP pear the following error is raised:

Notice: unserialize(): Error at offset 276 of 1133 bytes in Config.php on line 1050
ERROR: The default config file is not a valid config file or is corrupted.

关于如何解决此问题的一些建议?

Some suggestions how to fix this?

复制步骤:

  • 已安装MAMP(版本2.0.5)
  • cd/Applications/MAMP/bin/php/php5.3.6/bin
  • sudo ./pear升级花梨
  • 上面提到的错误被抛出

更新(1):

基于答案 8375349/420953 我尝试了两种解决方法

Based on answer 8375349/420953 I tried 2 possibilities to fix this

  • A:删除 pear.conf
    • rm/Applications/MAMP/bin/php/php5.3.6/conf/pear.conf
    • A: delete pear.conf
      • rm /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf
      • 将"php_dir"; s:44更改为"php_dir"; s: 43

      均导致错误:

      Could not get contents of package "/Applications/MAMP/bin/php/php5.3.6/bin/pear". Invalid tgz file.
      upgrade failed
      

      更新(2):

      运行

      • 哪个梨

      输出结果

      • /usr/local/bin/pear

      有了这个,我注意到我正在使用PEAR的本地"版本.

      With this, I noticed that I was using the "local" version of PEAR.

      我用

      • sudo pear卸载pear

      ,然后尝试使用升级PEAR的MAMP版本

      and then tried to upgrade the MAMP version of PEAR with

      • /Applications/MAMP/bin/php/php5.3.6/bin/pear upgrade pear

      这会导致错误

      Cannot install, php_dir for channel "pear.php.net" is not writeable by the current user
      

      升级

      • sudo/Applications/MAMP/bin/php/php5.3.6/bin/pear升级pear

      (再次)将其安装在本地.

      installs it locally (again).

      运行

      • 哪个梨

      输出

      • /usr/local/bin/pear

      这使我回到了更新(2)的起点.看来我无法在MAMP目录下升级PEAR.

      this brings me back to the starting point of Update (2). Seems that I am not able to upgrade PEAR under a MAMP directory.

      更新(3):

      我发布了问题

      因为我的假设是此问题的根源与MAMP PEAR配置有关.

      because my assumption is that the root of this issue is related to MAMP PEAR config.

      更新(4):

      我没有安装本地PEAR版本,这引起了很多问题.在还安装了本地版本(不仅是MAMP)版本之后,升级MAMP版本效果非常好.

      I did not install a local PEAR version and this was causing quite some issues. After also installing a local version (and not only the MAMP) version, upgarding the MAMP version worked perfectly.

      推荐答案

      遇到您确切问题的人似乎已经在此MAMP论坛主题.

      People with the your exact problem seem to has solved it in this MAMP forum thread.

      您可以删除/Applications/MAMP/bin/php/php5.3.6/conf/pear.conf,或将该文件中的行从"php_dir";s:44更改为"php_dir";s:43.

      You can either delete /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf, or change a line in that file from "php_dir";s:44 to "php_dir";s:43.

      这篇关于MAMP:如何升级PEAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 15:13