Cannot install install-pear-nozlib.phar on macOS Sierra - php

I’m trying to follow this tutorial https://codingexplained.com/dev-ops/mac/installing-php-intl-extension-os-x-mavericks in order to install the PHP extension intl on my Mac.
However, when I launch the command sudo php install-pear-nozlib.phar. I get the following error in my Terminal:
[PEAR] Archive_Tar: failed to mkdir /usr/lib/php/pear/Archive
[PEAR] Console_Getopt: failed to mkdir /usr/lib/php/pear/Console
warning: pear/PEAR requires package "pear/Archive_Tar" (version >= 1.3.7)
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.4)
warning: pear/PEAR requires package "pear/Console_Getopt" (recommended version 1.2.3)
warning: pear/PEAR requires package "pear/XML_Util" (recommended version 1.2.1)
[PEAR] PEAR: failed to mkdir /usr/lib/php/pear/OS
[PEAR] Structures_Graph: failed to mkdir /usr/lib/php/pear/docs/Structures_Graph/docs/html/media
[PEAR] XML_Util: failed to mkdir /usr/lib/php/pear/docs/XML_Util/examples
I don’t understand why it’s failing to make directories considering I’m using sudo for the command.
I thought it might be related to the root user, so I enabled it following these instructions https://coolestguidesontheplanet.com/enable-root-user-macos-sierra/, but that doesn’t change anything.
Anybody had this problem before?
Thanks in advance.

Related

Install pear on MacOS Mojave 10.14.3

I try to install pear:
curl -O https://pear.php.net/go-pear.phar
php -d detect_unicode=0 go-pear.phar
And I get warning:
PHP Warning: require_once(phar://go-pear.phar/PEAR/REST/13.php):
failed to open stream: phar error: "PEAR/REST/13.php" is not a file in
phar "go-pear.phar" in
phar:///Users/maksat/go-pear.phar/PEAR/Config.php on line 2067
Directory /Users/maksat/pear/bin is empty
How can I resolve this problem?
My OS: MacOS Mojave 10.14.3
I had some problems as well, this worked for me:
curl -0 https://objects-us-east-1.dream.io/kbfiles/pear/go-pear.phar
As this answer correctly suggests you may use this tool from Xdebug & check for recommendations for your particular case.

How do I install Sylius on Bluehost or any other server that has an old version of ICU installed?

I have been trying to get Sylius installed on my Bluehost server which is running on shared hosting and while I do have SSH access, it is somewhat limited. It did not come with the php intl extension and the version of ICU on it is 4.2 which produces errors when installing Sylius because it wants a newer version.
I tried this on a clean install of Sylius on my Bluehost server and got it to work.
I had previously installed the intl extension on my BlueHost server following https://my.bluehost.com/cgi/help/534
The intl extension is not required. See below. (I was attempting to install it before I realized I didn't need it)
After installing the extension, phpinfo() said the version of ICU was 4.2.
Note: on BlueHost you have to use php-cli instead of php to run php scripts from the command line
To install Sylius I ran:
wget http://getcomposer.org/composer.phar
php-cli composer.phar create-project sylius/sylius -s dev
When running create-project, I recieved the error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/icu 1.2.x-dev -> satisfiable by symfony/icu[1.2.x-dev].
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
Problem 2
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/intl 2.3.x-dev requires symfony/icu >=1.0-RC,<2.0 -> satisfiable by symfony/icu[1.2.x-dev].
- Installation request for symfony/intl 2.3.x-dev -> satisfiable by symfony/intl[2.3.x-dev].
I then used cd sylius to move into the new directory made from the partial project install.
From the section on http://symfony.com/doc/current/components/intl.html about ICU and deployment problems I added "symfony/icu": "1.1.*", (or add "symfony/icu": "1.0.*", if you do not have the intl extension installed) to the require section of composer.json
I then ran php-cli composer.phar update to get all the dependencies which takes a while (make sure you reference composer.phar correctly as it was downloaded into the parent directory)
After all the packages were downloaded, it asked for config parameters such as Database info
Then I ran php-cli app/console sylius:install
I ran php-cli app/console doctrine:fixtures:load and recieved the error:
[RuntimeException]
The country resource bundle could not be loaded for locale "en"
From info at https://github.com/symfony/symfony/issues/5279#issuecomment-12477297 and https://github.com/kbsali/sf2-icu I ran
wget https://github.com/kbsali/sf2-icu/tarball/master -O sf2-icu.tgz
tar xzvf sf2-icu.tgz
mv kbsali-sf2-icu-XXXX/4.2 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/
rm -rf kbsali-sf2-icu-XXXX sf2-icu.tgz
and then edited vendor/symfony/symfony/src/Symfony/Component/Locale/Locale.php and changed
const ICU_DATA_VERSION = '49';
to
const ICU_DATA_VERSION = '4.2';
I ran php-cli app/console doctrine:fixtures:load again and loaded all of the Data Fixures until LoadOrdersData failed with the error:
[ErrorException]
Warning: array_keys() expects parameter 1 to be array, object given in /home5/ozzieorc/public_html/sylius_clean/sylius/vendor/fzaninotto/faker/src/Faker/Provider/Base.php line 127
Then made the changes described at https://github.com/Sylius/Sylius/pull/216/files - hopefully this becomes part of the master branch and doesn't have to be changed when installing sylius
and ran php-cli app/console doctrine:fixtures:load a third time
I added my IP to the array of valid IP addresses in web/app_dev.php so I can run app_dev.php remotely from the BlueHost servers
In your browser you can go to web/app_dev.php and login to the admin area with
Username: sylius#example.com
Password: sylius
as the page suggests
Hopefully this helps anyone having problems with installing Sylius. It took me a while to figure it out. Let me know if there are any better ways of going about this.
Try this:
apt-get install php5-intl

Installing PHP 5.4 on RHEL5, getting caught in dependency rabbit-hole

I tried using webstatic, epel and remi repo's and all fail with the following error:
Missing Dependency: openldap >= 2.3.43-25.el5_8.1 is
needed by package libcurl-7.27.0-10.el5.remi.x86_64 (remi-test)
Fine, OK, openldap version on my system is:
sudo yum list package openldap
Installed Packages
openldap.i386 2.3.43-3.el5 installed
openldap.x86_64 2.3.43-3.el5 installed
(What's sad is i'm only off by a patch release -3 to -25! grr!)
Let's install OPENLDAP 2.4 from rpm since it's not available on any of the repo's:
wget http://someurl/downloads/openldap-2.4.24.tgz
tar -zxf openldap-2.4.24.tgz
cd openldap-2.4.24
./configure
Get this error:
checking if Berkeley DB version supported by BDB/HDB backends... no
configure: error: BerkeleyDB version incompatible with BDB/HDB backends
I just want to upgrade PHP 5.1 to 5.4 on RedHat Linux 5 86_x64. It doesn't have to be this freakin' complicated! Anybody have any ideas?
Compiling php from source is a dependency nightmare! but I attempted it anyway:
sudo rpm -ivh php54-5.4.16-1.ius.el5.src.rpm
Password:
warning: php54-5.4.16-1.ius.el5.src.rpm: Header V4 DSA signature: NOKEY, key ID 9cd4953f
1:php54 warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root x8
warning: user mockbuild does not exist - using root x8
########################################### [100%]
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
...repeated 8 more times.
i apparantly finished 100% but there's no sign of it under sudo rpm -qa | grep *php* returns zero results. (FYI: I have already 'yum removed' php 5.1 already)
Thanks for any help
I finally got this working through brute force. I downloaded all the RPMS for php I needed (cli,devel,common,pdo,mysql,xml,ldap).
I compiled openldap 2.3.5 from source and yum installed 'libedit' (one of the php rpms needed it
Then i ran rpm -ivh on each of the php rpm's. Some depended on each other so there's definitely an order to do them in (example pdo must go before mysql), but by trial and error PHP 5.4 is successfully installed.
Something that should have been as simple as
sudo rpm -ivh http://some.complete.repo/
sudo yum install php php-common php-cli php-devel php-xml php-pdo php-mysql php-ldap
But welcome to the world of Linux :P. (And one wonders how Microsoft did well over all these years with their crappy OS)
/end_rant
It's much easier to install epel and remi repositories and then do a yum install:
http://kb.parallels.com/en/115833

Install fileinfo php extension

As the fileinfo is moved from PECL to PHP. What is the best way to install it through WHM or putty.?
I tried following command:
pecl install fileinfo
and received following error:
WARNING: "pear/Fileinfo" is deprecated in favor of "channel://php-src/ext/fileinfo/in php sources
"WARNING: channel "pear.php.net" has updated its protocols, use "pecl channel-update pear.php.net" to update
downloading Fileinfo-1.0.4.tgz ...
Starting to download Fileinfo-1.0.4.tgz (5,835 bytes)
.....done: 5,835 bytes
3 source files, building
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
ERROR: `phpize' failed
This extension is enabled by default as of PHP 5.3.0. Before this time, fileinfo was a PECL extension but is no longer maintained there. However, versions prior to 5.3+ may use the » discontinued PECL extension.
Reference:
http://www.php.net/manual/en/fileinfo.installation.php
ERROR: `phpize' failed
This error is displayed because you don't have php-devel package installed
Are you install php-devel?
phpize execute need's php-devel package. if you are on centos run the following code
yum install php-devel
I encountered this, and needed to install php-fileinfo for WHM on a VPS Dedicated server. This https://www.inmotionhosting.com/support/website/how-to-install-a-php-extension-using-easyapache-4/
was very helpful. I figured id post this for the next guy.
For me this is working
#yum install rh-php70-php-devel
https://centos.pkgs.org/7/centos-sclo-rh/rh-php70-php-devel-7.0.10-2.el7.x86_64.rpm.html

PECL and PHP Build Directory

I'm trying to install a PECL package, and I received this error. I'm unsure what to do about it, so was hoping someone may be able to offer some help:
# pecl install -f ssh2
WARNING: failed to download pecl.php.net/ssh2 within preferred state "stable", will instead download version 0.11.3, stability "beta"
downloading ssh2-0.11.3.tgz ...
Starting to download ssh2-0.11.3.tgz (23,062 bytes)
........done: 23,062 bytes
5 source files, building
running: phpize
Cannot find build files at '/usr/lib64/php/build'. Please check your PHP installation.
ERROR: `phpize' failed
To use the pecl, pear, or phpize commands in fedora (redhat based), install the php-devel package:
$ yum install php-devel

Categories