php - Pear - Cannot execute on Uninstalled MAMP -
may question little stupid. i've tried solved 2 hours , cannot find solution.
firstly, i'm hobby , novice php developer. last year, installed mamp , pear on mac.
today, uninstalled old mamp (from last year) , reinstall new mamp. now, when type pear
command on terminal, following error occurs:
/users/naylin/pear/bin/pear: line 28: /applications/mamp/bin/php/php5.4.10/bin/php: no such file or directory /users/naylin/pear/bin/pear: line 28: exec: /applications/mamp/bin/php/php5.4.10/bin/php: cannot execute: no such file or directory
i know error occurs because php5.4.10/bin/php
no longer exist on machine. currently, have /applications/mamp/bin/php/php5.5.18/bin/php
according last updated mamp. don't know how solve problem.
update
as stony suggested in answer, try modify .pearrc
file. file located under ~/.pearrc directory. @ last line of file, there config definition s:44:"/applications/mamp/bin/php/php5.4.10/bin/php";
. modified correct path of php executable. in case, it's s:44:"/applications/mamp/bin/php/php5.5.18/bin/php";
.
but, error still occurs unfortunately. restart mac hope refresh config settings. still, error. (i described because assume may able solve error way on mac.)
how solved error
after trying 2 days solve problem, gave , try uninstall pear machine. , planned reinstall pear correct settings again. used following command uninstall it.
$ sudo pear uninstall pear
but problem could not run command. same error occured again.
so, tweaked it. error occurs because of configured directory php executable file not found. hence, created directory hand (i mean gui). in case, "/applications/mamp/bin/php/php5.4.10/bin/php"
. so, created "/applications/mamp/bin/php/php5.4.10/"
directory first. after that, copied files , folders "/applications/mamp/bin/php/php5.5.18/"
.
after that, error disappear , pear
command works gracefully again. can modify config settings of pear suggested in stony's answer (for correct php executable file). after modify settings, delete tweaked folder created earlier ("/applications/mamp/bin/php/php5.4.10/"
).
(in case, uninstalled pear. , use pear included mamp php5.5.18.)
i'm not sure whether correct way. hope experience problem me can solve error if don't found more correct solutions.
you set everywhere in pear configuration path php executable. have find file , change path new one.
you can use command change value:
pear config-get php_dir
then should work. show configuration can use:
pear config-show
and configuration file .pearrc
should somewhere in user directory.
https://pear.php.net/manual/de/guide.users.commandline.config.php
Comments
Post a Comment