Skip to content
This repository has been archived by the owner on Feb 11, 2019. It is now read-only.

Sturgeon Holmes: The Case of the Missing pearcmd.php #56

Open
philsturgeon opened this issue Oct 2, 2014 · 11 comments
Open

Sturgeon Holmes: The Case of the Missing pearcmd.php #56

philsturgeon opened this issue Oct 2, 2014 · 11 comments

Comments

@philsturgeon
Copy link
Contributor

So I've spent the last 5 hours trying to make PECL work, which of course means getting PEAR to work.

The trouble I'm having, is that in my little phpbrew + virtphp + OS X Mavericks world, the install-pear-nozlib.phar command is not doing what seems to be expected of it.

It's not making either of the following files:

  • ~/.virtphp/envs/foo-env/share/php/pearcmd.php
  • ~/.virtphp/envs/foo-env/share/php/peclcmd.php

This apparently does not happen on Linux, but on OSX it is happening for me over and over again.

(foo-env) $ which pear
/Users/phil/.virtphp/envs/foo-env/bin/pear
(foo-env) $ pear
Could not open input file: /Users/phil/.virtphp/envs/foo-env/share/php/pearcmd.php

I open this issue to document the discoveries, but right now all I have is...

wut-babka

The phar initiated in the Creator worker is just not making them files, and nobody seems to know why. The full command is:

/Users/phil/.phpbrew/php/php-5.5.17/bin/php -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0 /Users/phil/.virtphp/envs/foo-env/share/install-pear-nozlib.phar -d "/Users/phil/.virtphp/envs/foo-env/share/php" -b "bin" -c "etc"

We're expecting the files to appear in /Users/phil/.virtphp/envs/foo-env/share/php.

Help me. I can't get an article finished until this actually works and im onto the last paragraph. I want to escape this hell and never think about PEAR again.

I have suggested a template-based approach to add those two files, but @ramsey seems concerned that other files are also not being added, which sounds scary.

@philsturgeon
Copy link
Contributor Author

Strong suggestion so far of just deleting PEAR and adding support for Pickle, which does the same but doesn't suck ass.

@jwoodcock
Copy link
Member

@philsturgeon I like the suggest, but i think we need pear support to really offer a universal solution. It sucks, but it's a necessary issue to resolve.

@jwoodcock
Copy link
Member

Okay, so just checking my system, and for some reason I don't have this issue on OSX Mavericks. This was after the 0.5.1 pear fix attempt I push up.

So, I've some how solved the issue on my computer. I'll see if I can isolate what I've done.

@philsturgeon
Copy link
Contributor Author

I too am wondering if its some bullshit issue with having had PEAR installed a while ago and kinda removed since.

I dont know how to full kill PEAR to see if that was it. I will however have a brand new MBP tomorrow so maybe I can try there.

@jwoodcock
Copy link
Member

I got it working on a "dirty" system, so let me spend some time looking.

@jwoodcock
Copy link
Member

How did you install phpbrew?

@ashnazg
Copy link

ashnazg commented Oct 3, 2014

A shot in the dark, but... might there be a lingering ~/.pearrc folder from an old install? Settings in it might be overriding other PEAR behavior, particularly the subdirectory settings of where things are supposed to be located (e.g. bin_dir). Back when I used to manually install multiple PHPs and a PEAR in each, getting those subdir settings set and updating everything that was already installed was always needed, because many packages have token replacement strings in the code that gets overwritten at install time based on those subdir settings. Thus, an intial install with default subdir settings would put files in some locations, and some packages would then have those paths hardcoded in their own code. Thus, modifying the settings would only affect new installations, not currently installed packages. A forced update for all installed packages was necessary after any subdir config setting was changed.

@philsturgeon
Copy link
Contributor Author

Sadly not. I had a .pearrc a while ago but it complained when I ran that command myself. I deleted it and no more complaints.

$ ls -lah ~/ | grep .pear

Nothing a bit PEAR in there.

Not sure what you mean about the rest.

@philsturgeon
Copy link
Contributor Author

@jwoodcock I installed phpbrew with bog-standard

curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/bin/phpbrew

@ashnazg
Copy link

ashnazg commented Oct 3, 2014

Twas worth a shot :-) The rest about the subdir settings (bin_dir, data_dir, etc) is here (https://pear.php.net/manual/en/guide.users.commandline.config.php), and the lightbulb note about "When changing a config setting" is what I was meaning. An example of paths being hard-written into files at install time can be seen in the pear.sh file (https://github.com/pear/pear-core/blob/master/scripts/pear.sh)... look for "@php_dir@", which equates to the "php_dir" config setting seen in the earlier link.

@jwoodcock
Copy link
Member

@philsturgeon I will test that out. I have a clean mac for the new job, no homebrew, no phpbrew, and everything seems to work as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants