I'm pretty noob in terminal, so I wanted to start learning PHP and Laravel 4, and I have set up Apache server and installed Homebrew to install all other packages of PHP and composted and so on, but when I'm trying to install PHP on Homebrew, I always get an error:
This is the command I tried to install with:
brew install php53
I'm getting the following error message:
make: *** [sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1
READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
https://github.com/josegonzalez/homebrew-php/issues
/usr/local/Library/Homebrew/utils.rb:319:in `rescue in open': uninitialized constant
GitHub::OpenSSL (NameError)
from /usr/local/Library/Homebrew/utils.rb:304:in `open'
from /usr/local/Library/Homebrew/utils.rb:345:in `issues_matching'
from /usr/local/Library/Homebrew/utils.rb:373:in `issues_for_formula'
from /usr/local/Library/Homebrew/exceptions.rb:171:in `fetch_issues'
from /usr/local/Library/Homebrew/exceptions.rb:167:in `issues'
from /usr/local/Library/Homebrew/exceptions.rb:208:in `dump'
from /usr/local/Library/brew.rb:133:in `rescue in <main>'
from /usr/local/Library/brew.rb:72:in `<main>'
I always run brew doctor:
brew doctor
Which produces the following warning:
Warning: You have an outdated version of /usr/bin/install_name_tool
installed. This will cause binary package installations to fail. This
can happen if you install osx-gcc-installer or RailsInstaller. To
restore it, you must reinstall OS X or restore the binary from the OS
packages.
What am I doing wrong? How can I fix this problem?
It seems like others have had this issue. One suggestion was to use
xcode-select --install
I found that here: https://github.com/Homebrew/homebrew-php/issues/1172
If you've only just installed xcode tools, you might also be getting an earlier error stating that you haven't accepted xcode's license requirements. Try entering the command:
xcodebuild -license
and follow the instructions to accept the xcode T&C.
Related
I'm using MacOS Big Sur 11.4 and XAMPP 7.4.29. I have only basic knowledge on php and html. I want to go through mediawiki installion on my Mac for personal use. I encounter error message like screenshot below which basically I need to install intl extention in my PHP
I followed the instruction given here
Brew install autoconf
Change the path PATH=”/Applications/XAMPP/xamppfiles/bin:${PATH}”
Go inside the folder cd ext/intl/
Build /Applications/XAMPP/bin/phpize
I encounter error message
Cannot find config.m4. Make sure that you run '/Applications/XAMPP/bin/phpize' in the top level source directory of the module
After that I found a stackoverflow pages here addressing the issue of config.m4 and suggesting to
Install xdebug-2.6.1 (which was written 9 years ago and I can not find in internet)
Finding the file ls config* which I try and fail too
After that, I try to find other way to install the missing extention of php. I found this stackoverflow article. I followed the instruction
brew install icu4c
sudo pecl update-channels
sudo pecl install intl . In this step I put the path of ICU /opt/homebrew/opt/icu4c/
I stucked with an error message like below
/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/pear/temp/intl/php_intl.h:33:10: fatal error: 'unicode/ubrk.h' file not found
#include <unicode/ubrk.h>
^~~~~~~~~~~~~~~~
1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed
So that's all the thing that I have tried so far. My question since from the beginning has not been solved. How can I install the missing PHP extention so that I can proceed with the installation of mediawiki?
Thank you in advance
I need to run a php application that was built on php 7.3. Now that php 7.3 is no longer supported, I was unable to install using homebrew without including the --build-from-source option. I went ahead and attempted to build php 7.3 from source While trying to install and I encountered an error that terminated the build process:
Generating phar.phar
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
make: *** [ext/phar/phar.phar] Bus error: 10
make: *** Waiting for unfinished jobs....
I've researched the error and found that this may have to do with the fact that I am installing on a Mac with an Apple M1 chip. I'd like to uninstall it now, upgrade the application to a supported version of php, and then run it. I tried running brew uninstall php and then install home-brew's default php, but the binary that was created by the first attempt is taking precedence over the latter php 8.0 version I installed.
My question is, is deleting the binaries located at /usr/bin/ enough to completely remove the unsupported version of php from my system? I searched the tar for an uninstall target but no luck.
I just want to clean it out of my system and start over. I don't imagine that there is a php 7.3 version that works with my Apple M1 chip.
Thanks much
I have installed PHP(5.5.9) via Homebrew(0.9.5), and I can't seem to install any packages with pecl. For instance when I try to install APC with sudo pecl install apc I got the following string returned:
WARNING: php_bin /usr/local/Cellar/php55/5.5.9/bin/php appears to have a
suffix 55/5.5.9/bin/php, but config variable php_suffix does not match
If I just ignore the warning and proceed, at the end it fails with:
2 warnings and 6 errors generated.
make: *** [apc_compile.lo] Error 1
ERROR: `make' failed
I have make installed via homebrew as well as pecl.
APC is outdated, and has never been updated/released for PHP 5.5.
Since version 5.5, PHP comes with it's own opcache.
See: http://nl1.php.net/manual/en/book.opcache.php
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.
I get this error when i try to run following command
sudo pecl install mongo
Error:
...php_mongo.c:22:10: fatal error: 'php.h'
file not found
#include <php.h>
^
1 error generated.
make: *** [php_mongo.lo] Error 1
ERROR: `make' failed
I am new to MAC, please help me to resolve this and get Mongo Working with PHP.
I have installed MacPorts and autoconf
It seems, that you did not install the xampp "Developer Package", required to build additional php extension. You can download the "Developer Package" from:
http://www.apachefriends.org/en/xampp-macosx.html#849
This has already been answered.
Please follow the processes outlined in this answer - Install PECL on Mac OS X 10.6.
I followed the process outlined here http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/, referenced by the above Stackoverflow link and the process for install pear, followed by pecl and subsequently -
sudo pecl install mongo
works perfectly on OSX Lion.
You may need to modify the extensions in /etc/php.ini, however, this is explained in the output after you install the php mongo driver.
It took me the whole day to find this answer, I had tried everything, but this worked finally:
sudo C_INCLUDE_PATH=/usr/local/opt/openssl/include /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
I found this article very helpful. Saved a lot of time after I wasted a lot of time to check other links. I did for MAMP and think will work for XAMPP too.
The thing is MAMP does not ship with all PHP sources to compile pecl mongo file and create mongo.so. All what you need is download php for respective version you are using. I was using php version 5.6.10. I checked php.net site that was having 5.6.13 version. I downloaded sources for this version from PhP.net. Executed "sudo pecl install mongo" again and it worked.