Hello people of the internet
I am new to Linux.
I'm moving over from Windows.
I'm trying to install the PECL expect package for PHP: https://pecl.php.net/package/expect
I've followed the instructions on these pages.
But both give me errors, which I've details below:
https://www.php.net/manual/en/install.pecl.phpize.php
$ cd extname
$ phpize
$ ./configure
$ make
# make install
When I get to the ./configure, the last two lines in the terminal say:
checking specify path to Tcl needed by expect... yes, shared
checking for tcl version... configure: error: not found
I have Tcl installed, and it's the latest version.
When I try the make command it says:
make: *** No targets specified and no makefile found. Stop.
I can't find a makefile, only a Makefile.global, Makefile.fragments, and Makefile.objects
https://www.php.net/manual/en/install.pecl.pear.php
sudo pecl install expect
The last line in the terminal say:
ERROR: `/tmp/pear/temp/expect/configure --with-php-config=/usr/bin/php-config' failed
I looked on the net, and installed every dependency that others recommended, but it still doesn't work.
I've downloaded so many dependencies now, that my machine is probably not safe anymore...
Does anybody know what else I need to do to install the package?
I'm using Linux Mint 19.3.
Thanks.
Related
I am configuring local cakephp 3, but I am not able to install ext intl on mac, I have the following error when trying:
1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make 'failed
this error occurs when executing the following command:
sudo pecl install intl
Can someone help me with this? thank you!
So many time later, i finally fix it:
First make sure you installed Xcode and started it at least once to finish installation and accept license agreement.
Download latest version of autoconf from
http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz.
Its a prerequisite to build php modules which is not shipped with macOS.
Extract the file and open a terminal in macOS and open the extracted folder using cd command.
Afterwards use commands:
./configure
make
sudo make install (your password is required, make sure you are an admin user in macOS)
Download the version of php you use in xampp from php.net
Extract it and open the extracted folder in a terminal using cd.
Change to subfolder ext/intl.
Run these commands to build the extension:
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install (password required)
Delete all files you downloaded and also the extracted folders.
Add to php.ini file in xampp/etc folder line
extension="intl.so"
Since intl-extension has to be compiled anew each time you installed a new version of xampp I wrote a shell script to do this for me.
Good day, everyone.
Usually I just using this Official Docs in *nix OS
But now i'm using MacOs and this instructions just doesn't work properly.
In case of pecl install cassandra I got this message:
checking for supported DataStax C/C++ driver version... awk: can't open file /include/cassandra.h
source line number 1
configure: error: not supported. Driver version 2.4.2+ required (found )
ERROR: `/private/tmp/pear/install/cassandra/configure --with-php-config=/usr/bin/php-config' failed
My logic tell me that in that case I need make DataStax C/C++ driver by my own. In folder php-driver\lib I deleting cpp-driver and using this instruction make new and fresh C/C++ driver without errors.
So in official doc it says:
Note The install.sh script will also compile and statically link into the extension a submoduled version of the DataStax C/C++ driver for Apache Cassandra. To use a version of cpp driver that you already have on your system, run phpize, ./configure and make install.
But when i trying to run ./configure from php-drive/ext I got almost the same error:
checking for supported DataStax C/C++ driver version... awk: can't open file /include/cassandra.h
source line number 1
configure: error: not supported. Driver version 2.4.2+ required (found )
Even if I continue and after that error run make install it gives me that log:
/bin/sh /Users/antvirgeo/php-driver/ext/libtool --mode=install cp ./cassandra.la /Users/antvirgeo/php-driver/ext/modules
cp ./.libs/cassandra.so /Users/antvirgeo/php-driver/ext/modules/cassandra.so
cp ./.libs/cassandra.lai /Users/antvirgeo/php-driver/ext/modules/cassandra.la
----------------------------------------------------------------------
Libraries have been installed in:
/Users/antvirgeo/php-driver/ext/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20121212/
cp: /usr/lib/php/extensions/no-debug-non-zts-20121212/#INST#24727#: Operation not permitted
make: *** [install-modules] Error 1
Libraries have been installed in:
/Users/antvirgeo/php-driver/ext/modules
Even if I adding cassandra extension with that path to php.ini I still got error Class 'Cassandra\SimpleStatement' not found in my project.
php -d="extension=modules/cassandra.so" -m showing that cassandra in list of PHP Modules
What am I doing wrong?
PS: I have ubuntu OS in Parallels with this project with DataStax php driver installed with this instructions works fine.
____upd:
After all instructions of #Fero without ANY ERRORS, command /usr/local/bin/php -i | grep -A 10 "^cassandra$" showing me this:
cassandra
Cassandra support => enabled
C/C++ driver version => 2.4.2
Persistent Clusters => 0
Persistent Sessions => 0
Directive => Local Value => Master Value
cassandra.log => cassandra.log => cassandra.log
cassandra.log_level => ERROR => ERROR
And still the same error - Class 'Cassandra\SimpleStatement' not found
______________UPDATED LAST:
Aaaaand it's working! I wrote output phpinfo(); in my project and realize that apache using other php version and php.ini, where wasn't extension=cassandra.so at all.
You will need to install the DataStax C/C++ driver which is a dependency of the PHP driver. Using these instructions followed by make install after the driver has been successfully built will ensure this dependency is available when building the PHP driver. Using the PHP driver build instructions you will need to make sure that GMP and PHP dev libraries are also available before running pecl install cassandra.
EDIT:
Since you are using El Capitan you are running into issues with the System Integrity Protection and you will need to disable it in order to copy files into /usr. The better and recommended option is to install PHP using Homebrew; however you can also use MacPorts if preferred.
Below are the steps used to reproduce the installation of the PHP driver on a clean OSX El Capitan image with Xcode and Homebrew already installed:
brew install autoconf cmake libuv gmp openssl pcre homebrew/php/php55
brew link homebrew/php/php55
mkdir code
pushd code
git clone https://github.com/datastax/php-driver.git
pushd php-driver
git submodule update --init --recursive
pushd lib/cpp-driver
mkdir build
pushd build
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
make -j$(sysctl -n hw.ncpu)
sudo make install
popd
popd
mkdir build
pushd ext
/usr/local/bin/phpize
popd
pushd build
../ext/configure --with-php-config=/usr/local/bin/php-config
make -j$(sysctl -n hw.ncpu)
sudo make install
popd
popd
sudo sh -c 'echo "extension=cassandra.so" >> /usr/local/etc/php/5.5/php.ini'
You can then verify the installation using the following command:
/usr/local/bin/php -i | grep -A 10 "^cassandra$"
NOTE: PHP v5.5 is utilized above since that is the default version that comes with El Capitan; PHP v5.6 and v7.0 can also be used instead.
If you need to install the Cassandra PHP extension on MacOS, you can do this simply by installing it via PECL, without having to do anything with turning on or off System Integrity Protection. I've written a blog post with easy step-by-step instructions. It also includes a link to installing PHP from Homebrew since they removed the Homebrew/php tap back in April of this year.
It also by passes the incorrect instructions given on the DataStax website. In short ...
Install Dependencies (I run these commands one at a time to easily view any messages):
$ brew install autoconf
$ brew install cmake
$ brew install automake
$ brew install libtool
$ brew install gmp
$ brew install libuv
$ brew install openssl
Retrieve and build the C++ driver and then create a build directory inside the cpp-driver folder:
$ git clone https://github.com/datastax/cpp-driver.git --depth=1
$ mkdir cpp-driver/build
$ cd cpp-driver/build
Make and build the driver with a qualified call to OpenSSL:
$ cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
$ make
$ make install
Now you're good to go to install the Cassandra PHP extension libraries using PECL:
$ pecl install cassandra
Check to make sure that the Cassandra extension was added to your PHP.ini file. If not add it.
[cassandra]
extension="cassandra.so"
Restart Apache and you're off and running with Cassandra in PHP.
If you want more detail on what's happening in the above instructions, refer to my blog post here:
https://medium.com/#crmcmullen/how-to-install-the-cassandra-php-driver-on-macos-10-13-high-sierra-and-10-14-mojave-c18263831ccb
I have began installing pecl on MAMP. I have added the correct php version to the path and when which php it says /Applications/MAMP/... which is correct.
I have downloaded the Server Components and libraries moved them to a new folder in my php and run the ./configure everything seems to run ok and looked through all the checks being performed while installing and unpacking.
It gets to the last line and says;
configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>
Where should I set the <DIR> for the iconv?
Just make another folder and point it at that?
I am only trying to get the mongo pecl installed.
The information I have followed is here http://www.lullabot.com/blog/article/installing-php-pear-and-pecl-extensions-mamp-mac-os-x-107-lion
Wait wait wait wait. Why are you rebuilding your PHP installation to install the MongoDB driver?
You don't have to do that.
Just run e.g.:
/Applications/MAMP/bin/php/php7.1.1/bin/pecl install mongo
Assuming thats the full path to the pecl command part of your MAMP installation.
You might need to replace /php7.1.1/ with your current and active MAMP php version.
Working on this right now and found a workaround to just disable iconv with ./configure --without-iconv which not the best solution of course, but works for me.
Edit: Downloaded libiconv-1.14 package, and after running ./configure , make, make install, PHP configure runs fine.
This did it for me:
$ ./configure --with-iconv=/usr/lib/
First needed to install libxml2 and libxslt via homebrew though:
$ brew install libxml2
$ brew install libxslt
I'm having some issues with getting mcrypt setup on my local php server. I initially tried to use homebrew, but when calling a mcrypt function, it said that it errored saying that the function was unavailable.
I tried troubleshooting a bit, but I think I accidently added mcrypt to a place other than the homebrew installed php, and now I can't seem to uninstall it, and now I can't seem to install mcrypt through homebrew anymore. I get the following error:
{php-5.3.27 tim$ brew install mcrypt
==> Downloading http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/
Already downloaded: /Library/Caches/Homebrew/mcrypt-2.5.8.tar.gz
==> ./configure --prefix=/usr/local/Cellar/mcrypt/2.5.8 --mandir=/usr/local/Cell
==> make install
Warning: Could not link mcrypt. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link mcrypt'
Possible conflicting files are:
==> Summary
🍺 /usr/local/Cellar/mcrypt/2.5.8: 12 files, 348K, built in 26 seconds}
any help would be great
thanks
The following command of ./configure is make.
and, next is make install.
./configure
make
make install
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.