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.
Related
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.
I am not a Linux User.
I recently install ImageMagick on a CentOS via this tutorial:
https://www.vultr.com/docs/install-imagemagick-on-centos-6
Seems everything installed normally...
But After install,It seems I do not have "imagick.so" in my server...
I got this error with 'php -m | grep imagick' command:
PHP warning: PHP Startup: Unable to load dynamic liberary
'/usr/local/php54/lib/php/extentions/no-debug-non-zts-20100525/imagick.so:
cannot open shared object file: No such file or directory in Unknown
on line 0
Also I search by locate imagick.so and couldn't find any file.
Also convert --version, It return me the version 6.9.0.0 Q16 X86_64
But I couldn't run any of this code:
http://php.net/manual/en/imagick.examples-1.php
Now the question:
Is there a "imagick.so" file to download it to the server myself?
for example there are a lot of dll file for windows with same error...
How can I solve this problem?
I am on a VPS (centOS6.5/php5.4)
-----------------------Edit
I typed: locate imagick.so
the result:
/usr/lib64/php/modules/imagick.so
usr/lib64/ImageMagick-6.5.4/modules-Q16/coders/magick.so
then I try run: sudo /usr/bin/pecl install imagick
the result:
Php warning: PHP Startup:Unable to load dynamic liberay
'/usr/lib64/modules/imagick.so' - /usr/lib64/modules/imagick.so:
cannot open shared object file: No such file or directory in Unkown on
line 0
.
.
. Please provide the prefix of Imagemagick installation
[autodetect] :
can help me more what can I to do?
You can install imagick extesion with php pecl.
Open your terminal and execute:
sudo /usr/bin/pecl install imagick
sudo echo "extension=imagick.so" > /etc/php.d/imagick.ini
sudo /etc/init.d/httpd restart
After you can test, if was installed correct:
sudo php -m | grep imagick
This is what I followed and helped me resolve this issue. Hope this helps to everyone. We need to remove old Imagick and install new with this procedure. Link Imagick
I am trying to build the memcached extension on OS X 10.9 Mavericks for use with the built in PHP 5.4, initially I tried pecl install memcached but that threw the following.
checking for zlib location... configure: error: memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located
ERROR: `/private/tmp/pear/install/memcached/configure' failed
So I created a tmp directory and executed pecl download memcached, unzipped the code and cd'd to the appropriate directory.
Trying to phpize it returned the following:
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
I had brew installed zlib a while ago and pointed ./configure at my installation.
./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8 I was greeted with the following error message:
checking for session includes... configure: error: Cannot find php_session.h
So now I'm wondering the best course of action here... /usr/include/ doesn't exist at all... is this a Mavericks thing? I don't remember having this problem in 10.8 at all.
I could try brew installing php-devel but I presume that isn't going to be the right version of what I need? Any help would be greatly appreciated here
Update
locate php_session.h reveals
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/ext/session/php_session.h
should I just ln -s this to the expected location or is there some way to do this via XCode? I have the command line tools installed...
run xcode-select --install to install the XCode5 Command Line Tools, then sudo pecl install memcache. You should be good to go.
After install XCode5 Command Line Tools as afessler sugest (xcode-select --install) I couldn't do the "sudo pecl install memcache" because pecl was missing.
I had to install PEAR and PECL following this guide: http://techtastico.com/post/como-instalar-pear-y-pecl-en-os-x-mavericks/.
Then all worked good. Thanks!
I had this problem and it was due to MAMP not having all the PHP sources.
I found this really helpful solution that explains how to download and configure them:
https://stackoverflow.com/a/11175197/369326
Note that the MAMP components doesn't include the extras for any versions of PHP higher than php 5.4.10 but you can download the extras from http://php.net/releases.
As said above but not using xcode install
Try installing pecl manually:
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
and then:
sudo pecl install memcache
See more at: http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/#sthash.x2LKdqj6.dpuf
ORIGINAL POST
First of all, I want to install memcached, not memcache.
I'm trying to set up memcached to work with my lampp server on ubuntu 12.10 since yesterday. I've already followed almost every tutorial I could find. The most recent thing, I tried to do was:
in terminal
apt-get install libmemcached-dev
cd /opt/lampp
./bin/pecl install memcached
and then adding extension="memcached.so" in php.ini file. After this I restarted lampp using /opt/lampp/lampp restart
When I tried to open php script in my browser it just got downloaded. Running tail -20 /opt/lampp/logs/php_error_logthis is what I see:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcached.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcached.so: wrong ELF class: ELFCLASS64 in Unknown on line 0
It seems this guy had same problem but with different extension. When I try to compile 32 bit version of the extension using:
phpize
CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure
make
But make throws the following error:
/usr/bin/ld: skipping incompatible /usr/local/lib/libmemcached.so when searching for -lmemcached
/usr/bin/ld: cannot find -lmemcached
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make: *** [memcached.la] Error 1
The problem is that I don't even know if I'm on the right path. If someone could write short step-by-step guide how to get this working or just show me where the issue is it would be great.
UPDATE
After executing sudo dpkg --add-architecture i386 sudo apg-get update sudo apt-get install libmemcached-dev:i386 libz-dev:i386 and phpize CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure make memcached compiles fine. It still doesn't work however. After checking php error logs again I get this
PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcached.so' - /opt/lampp/lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6) in Unknown on line 0
You are on the right path - your lampp is 32bit while rest of the system (i assume) is 64bit. So when you installed libmemcached an compiled php-libmemcached it is 64bit version. That's why you get the "Wrong ELF class" error.
Before you can compile 32bit version of php-memchached you need to install 32bit versions of libmemcached and libz (and their headers).
You need to:
sudo dpkg --add-architecture i386
sudo apg-get update
sudo apt-get install libmemcached-dev:i386 libz-dev:i386
I think that should be enough to let you compile 32bit version of php-libmemcached.
There is a dirt way to fix your problem
go to /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.x.x
and copied the libgcc_s.so into
/opt/lampp/lib and renamed it to libgcc_s.so.1 to overwrite the previous file.
Does anyone know how to install PHPUnit on Mac OS X (I'm using XAMPP). I tried the following commands and it said installation succeeded (no errors). Now, when I try to run a phpunit command in Terminal, I get an error that the command phpunit could not be found. Also, running "which phpunit" returns nothing.
The commands I ran:
$sudo /Applications/XAMPP/xamppfiles/bin/pear channel-discover pear.phpunit.de
$sudo /Applications/XAMPP/xamppfiles/bin/pear channel-discover pear.symfony-project.com
$sudo /Applications/XAMPP/xamppfiles/bin/pear channel-discover components.ez.no
$sudo /Applications/XAMPP/xamppfiles/bin/pear install -a phpunit/PHPUnit
Thanks.
Installing PHPunit through XAMPP almost drove me mad, an error was telling me that my xdebug version was to old to install the Coverage lib required for PHPunit, three seconds later another was telling me that everything was fine but no phpunit command was installed.
I've chosen to bypass that problem by installing phpunit at system level (outside of XAMPP).
cd /tmp
curl http://pear.php.net/go-pear.phar > go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
This should install pear (and tell you where, default is in your home).
cd ~/pear/bin
sudo ./pear channel-discover pear.phpunit.de
sudo ./pear channel-discover pear.symfony-project.com
sudo ./pear channel-discover components.ez.no
sudo ./pear install -a phpunit/PHPUnit
./phpunit should now return you something (in my case it's displaying that some import where unmet.
Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in ~/pear/share/pear/PHPUnit/Autoload.php on line 45
Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:') in ~/pear/share/pear/PHPUnit/Autoload.php on line 45
If you don't have a /etc/php.ini, create it:
sudo cp /etc/php.ini.default /etc/php.ini
Then edit /etc/php.ini and set the right path:
include_path = ".:/php/includes:/Users/YOURUSERNAME/pear/share/pear"
Then calling ./phpunit in your pear bin directory should work... It's quite a pain comparing to a few aptitude and pear call on Ubuntu, but it let you work on OSX. You should be able to still use XAMPP as a webserver but remember that XAMPP uses its buildin PHP environment, phpunit will use the one of your system.
AsTeR's method worked for me though because being stuck with old PHP 5.3.1 current PHPUnit versions will complain because function stream_resolve_include_path is missing.
So I ended up used the solution together with this answer: https://stackoverflow.com/a/8249291
I did as #trent-scott did and got same error.
Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:')
As you can notice there is an empty include path (include_path='.:')..
Go to your php.ini file. Figure out which by doing this in terminal 'php --ini'.
Make sure you've got something similar to this somewhere in the file (be sure to replace username):
include_path=".:/Users/hfossli/pear/share/pear"
It should be sufficient, but I for some reason got this (be sure to replace username):
include_path=".:/Applications/XAMPP/xamppfiles/lib/php/pear:/Applications/XAMPP/xamppfiles/lib/php/pear:/Users/hfossli/pear/share/pear"
I fund an other temporary solution that worked for me. Instead of using the pear command directly within your Xampp app, try using the full path to pear executable like : /Applications/XAMPP/xamppfiles/bin/pear
hope it helped.