Googling revealed several blog posts for Leopard. The first of which I encountered was, How To Install PEAR in Mac OS X Leopard. The first instruction is not consistent with the version of PHP distributed with Lion, which prompted this blog article. I received the following error:
Sorry! Your PHP version is too new (5.3.6) for this go-pear.If you are using Lion, follow these instructions for completing the installation process for pear.
Instead use http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.
The first step is downloading the pear PHAR. Make sure that you execute this command in a directory where you have write permissions. I chose my home directory.
Next, run go-pear to complete the installation process of the library.curl http://pear.php.net/go-pear.phar > go-pear.phar
When prompted with the installation locations, change the "Installation base" setting to /usr/local/pear. Press enter, and watch the installation complete.sudo php -q go-pear.phar
As documented in the installation instructions in the posting, How To Install PEAR in Mac OS X Leopard, you will need to create the php.ini. (I am documenting the steps here for completeness.)
Copy php.ini.default to php.ini.
Next, edit the php.ini file.sudo cp /etc/php.ini.default /etc/php.ini
Lastly, update the php.ini configuration to include following line to reference pear libraries.sudo vi /etc/php.ini
Restart your Apache server or run your PHP script. Everything should work as expected.include_path = ".:/usr/local/pear/share/pear"
hi, I followed your steps, when I did 'sudo php -q go-pear.php', I still got the message
ReplyDelete'Sorry! Your PHP version is too new (5.3.6) for this go-pear.
Instead use http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.'
How can i make sure that i execute this command in a directory where i have write permissions?
I updated the curl command to capture the go-pear.phar library to a file. Not sure if that was causing you issues.
ReplyDeleteDoes that happen after downloading the latest version of go-pear.phar? I just tried it myself again without any errors. My version of PHP is 5.3.6. Here are the full details of running 'php -v'
PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep 8 2011 19:34:00)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
My php version is the same as yours. I tried again, but it still comes to the problem I mentioned.
DeleteHow to updated the curl command to capture the go-pear.phar library to a file ?
how can I show you my shortcut picture ?
DeleteThe following is the process:
ReplyDeleteYang-WenmatoMacBook-Pro:~ Young$ curl http://pear.php.net/go-pear.phar > go-pear.phar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3594k 100 3594k 0 0 27867 0 0:02:12 0:02:12 --:--:-- 33590
Yang-WenmatoMacBook-Pro:~ Young$ sudo php -q go-pear.php
Password:
PHP Deprecated: Assigning the return value of new by reference is deprecated in /Users/Young/go-pear.php on line 733
Sorry! Your PHP version is too new (5.3.6) for this go-pear.
Instead use http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.
Thank you for your coopertion and sorry for the inconvenience!
and Thank you for helping me!
Everything you have done is identical to what I have done. I wonder if you have a different reference to php in your path. When I do "which php" it returns the path "/usr/bin/php". I would verify that it is the same when you run "sudo which php". Your root account may have a different path setting which could maybe possibly cause an issue. I am really kind of just grasping at straws.
Deletewhen i type 'which php' it returns the same path "/usr/bin/php".
Deletedo you think i need to install an old version php to finish it ?
There is one other discrepancy I see in my post. Make sure you are executing the following: 'sudo php -q go-pear.phar'. You might have a .php file in that same location. That could be causing the problems you are seeing. That may be an older version that is causing the issue.
DeleteI had trouble to run 'sudo pear install "package"' (sudo: pear: command not found)
ReplyDeletethat was fixed when I added export PATH=/usr/local/pear/bin:$PATH in my ~/.bash_profile
thanks dajjen I had the same problem!
ReplyDelete