I was able to successfully install the mcrypt extension on Mountain Lion but I'm having a difficult time installing the extension on Mavericks.
For reference, I'm following this guide: http://www.coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-9-mavericks-development-server/
The only inconsistency I've noticed is that by running php -v from the command line, I'm showing PHP version 5.3.15 - whereas the web server appears to be running 5.4.17. I downloaded 5.4.17 to compile mcrypt.
Basically, everything runs according to plan until the very end. Rather than installing the shared extensions into the new directory, /usr/lib/php/extensions/no-debug-non-zts-20100525, I get a message that says:
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
EDIT:
The issue appears to be that the web server's PHP was compiled with module API: 20100525 and the system is still using 5.3.15 (which is API: 20090626), hence the error.
I'm assuming you can't (easily) update the system version of PHP. What do I need to do to get the module and PHP APIs to match?
Thanks in advance for any help.
For reference of others finding this thread..
Here is an automated Mcrypt installer for 10.8 and 10.9.
http://topicdesk.com/downloads/mcrypt/mcrypt-download
Less than a minute to install this way.
I noticed that php 5.4.17 is located in /usr/bin and 5.3.15 is in /usr/local/bin,
so I:
created symlinks in /usr/local/bin to phpize and php in /usr/bin.
After I verified that phpize -v and php were pointing to the correct version, it was simply a matter of recompiling the mcrypt extension. After doing so, the extensions were installed in the correct directory:
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20100525/
I think in retrospect all I needed to do was add /usr/bin to my path variable so that it checks /usr/bin before /usr/local/bin.
Related
I followed the instructions outlined here:
Install PHP Internationalization extension (Intl) on XAMPP on Mac
Ran sudo pecl install intl
selected the correct files from the Cellar
then this error happened:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error:
'ext/standard/php_smart_str.h' file not found
include
^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed
No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart_string.h
So given my scant knowledge of C++ I copied smart_string.h to smart_str.h and renamed all the headers from STRING to string.....
re-ran pecl -no luck....more errors......without knowing where the .c files are and remaking php (not really interested in going that far) since anyway I'm using XAMPP so that ended that option.
I have php 5.5 on my mac, deep in the usr/local/bin folder
so next step was to get pecl to use those files and generate an intl.so file....
Did that....I have the intl.so file so put it in the 'extensions' folder in XAMPP (for reference: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012)
Ran php and came up with this error:
Warning: PHP Startup: Unable to load dynamic library
'/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so'
- dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so,
9): Symbol not found: _zval_used_for_init Referenced from:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
Expected in: flat namespace in
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
in Unknown on line 0
I imagine it has to do with different versions?
In any case I can't get pecl to install intl without a make error in PHP 7.0.8 on XAMPP. There is no documentation on this and you'd think that if you deprecate a header.h file you'd update all extensions?
Install intl.so in PHP 7 seems impossible?
After a lot of research I was finally able to resolve this. Detailed steps here:
before you begin, check which php path is set. it should be /Applications/XAMPP/xamppfiles/bin/php. If not you can change it by PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}". more detail here
Overall idea is to build the intl-extension from PHP source code on your own. Before you begin make sure you have installed Xcode. Also, install the latest version of autoconf. this might help:
brew install autoconf
Next download the version of PHP you use in XAMPP from php.net. I am using 7.1.18. This version worked for me: php-7.1.31, I’m guessing if you follow the steps it might work for 7.0 or 7.2 as well. Do let me know if it does or doesnt, I’ll update this post. Do not use PHP 7.3 for Magento 2.3.0, it is not supported.
Extract the tar.gz file using (I extracted it inside ~/Downloads/ folder )
tar -xzvf php-7.1.31.tar.gz
cd into the extracted folder
cd php-7.1.31
change to subfolder ext/intl
cd 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
you can now delete all files you downloaded and also the extracted folders.
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and add extension=intl.so
Restart your Apache using XAMPP GUI and it should work.
So far, it seems that extension intl.so for php is bundled with php
and should be compiled with php (intl --enabled). XAMPP does not support this (as of Oct 2016), MAMP does. I do not know about other distros. However, if you're willing to recompile PHP 7, it's worth it just to do that and enable it during compiling.
So....I ran with MAMP. Then I decided that I would simply install apache 2.4 and php 7 and Mysql without the stack and the junk that comes with MAMP or XAMPP and everything works like a charm... so if you need to use CakePHP or intl support etc... just drop XAMPP/MAMP and go with a standard install. I used homebrew (MacOS) and everything is working fine.
Update: As regards Windows, XAMPP does not default it, but you can add the module (dll) in php.ini and works like a charm
The error means that XAMPP doesn't have PHP compiled with intl. You may try:
pecl install intl
but probably it won't work as well.
See: PHP Bug #72879 Pecl install intl make error with PHP 7.0.8.
As for the workaround, try installing memcached extension instead of memcache, e.g.
pecl install memcached
Note: It also requires libmemcached package/library to be installed beforehand. For macOS, install via: brew install libmemcached.
If you wanna try without homebrew, with native apache and php, look at my aswer here: https://stackoverflow.com/a/55131868/3692846
I am unable to install composer on my local system. Following are my local system and PHP details:
OS - Windows 8.1 Pro - 64 Bit OS - X84- based processor
I have installed XAMPP -
PHP Version 5.6.8.
On trying to install composer, it requested PHP_pdo.dll. However, I downloaded the dll and placed it into the xampp/PHP/ext folder
But seems some versioning issue. Where can I get PHP_pdo.dll for PHP Version 5.6.8 VC11 X84?
composer is installed using the PHP CLI (Command Line Interface)
The php.ini that controls the CLI is in your \xampp\php folder (its not the same one that controls PHP under Apache).
Edit \xampp\php\php.ini and make sure that
extension=php_pdo.dll
is not commented out, a comment has a # in column 1
That said, you had better get the original php_pdo.dll back that was in xampp\php\ext as there is no way of knowing if you put a good or bad new version in when you did whatever you did with the new one
I would like to compile the php pecl extension ev http://pecl.php.net/package/ev for PHP 5.5+ into a dll-file on Win 8.1 64-Bit.
I have already downloaded the ev source-code and already installed Visual Studio Express(!) 2012. What do i have to do next? How can i compile the source-code?
There is no file->new->project from existing code in Visual Studio Express(!).
I have also already tried to install the pecl exptension with the pecl command. But this doesn´t work:
C:\xampp\php>pecl install ev No releases available for package
"pecl.php.net/ev" install failed
Check install.md file there are all informations what you need.
To be honest you can't install it doing with pecl command because there is information:
Currently GNU/Linux platforms supported only.
There is also manual installation guide but probably you would need to do it with MinGW/MySYS if any. I suppose you would need to edit sources.
mingw-w64 project has replaced mingw and mingw-build.
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.1/threads-posix/sjlj/
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.1/threads-posix/sjlj/
you can of course pick a different version number by going up to a parent dir in the file tree. for example, if you look in the personal builds, you would find the most up-to-date:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/dongsheng-daily/4.9/
gcc uses not .lib files but instead .a files for libs, and php includes a .lib for devs, so immediately I know it's for VC++ (and it was compiled with that and it says so for the windows target download).
after you have correctly configured MSYS (not an easy job),
./configure;make;make install
./configure gives me the error:
configure: error: xml2-config not found. Please check your libxml2 installation.
libxml2 requires python, which certain windows antivirus packages remove from mingw-w64.
I am trying to install phpdbg on OS X. The docs say to cd to /usr/src ... I don't have that directory. What normally goes in /usr/src/php-src/sapi? The php source? If so, where can I find the equivalent directory on OS X? I can't find a php-src directory using finder.
From the docs:
Installation To install phpdbg, you must compile the source against
your PHP installation sources, and enable the SAPI with the configure
command.
cd /usr/src/php-src/sapi
git clone https://github.com/krakjoe/phpdbg
...
In the docs, the directory /usr/src/php-src is used as a sample location to indicate the source directory the copy of PHP compiled on your system. Instead, use the directory containing the source for your local PHP install.
If you installed PHP through a package manager instead of compiling it yourself, find the corresponding source package in the package manager, install the source package, and use the directory it installed to instead of /usr/src/php-src.
You will also need to use the same compiler and toolchain used by the upstream package manager.
If you use homebrew, it's easy.
With PHP 5.6, I think it's included by default. I haven't upgraded from PHP 5.5, yet.
I already had php55 installed (substitute install for reinstall if this is a new install).
brew reinstall php55 --with-phpdbg
(This is reported to work for PHP 5.4 too. I haven't tried it.)
I followed the following steps to install mongo's php drivers with lampp.
http://abstract2paradox.wordpress.com/2012/01/26/adding-mongo-db-driver-to-xampp/
When I start lampp its gives the following error
Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so: wrong ELF class: ELFCLASS64 in Unknown on line 0
Any ideas?
Thanking you
This means that your PHP is compiled in 32-bit mode, but the mongo extension as 64-bit mode. I believe Apple's compiled PHP is in 32-bit mode as well, you can verify that with:
php -r 'echo PHP_INT_MAX, "\n";'
If that shows 9223372036854775807 you're on a 64-bit platform.
Now, in your case you will need to make sure that you compile the MongoDB extension with a 32-bit architecture. From http://artur.ejsmont.org/blog/content/how-to-build-mongodb-pecl-extension-in-32bit-for-php-52-on-macosx-snow-leaopard I believe you can do that with:
pecl download mongo
tar -xvzf mongo-1.2.7.tgz
cd mongo-1.2.7
CFLAGS="-m32"
phpize
./configure
make
make install
The problem was as is outlined by Derick above. Although the way the problem got solved was download a 32 bit version of the ubuntu os and running it as a virtual machine on my pc using vmware. Later followed the 'Manual Installation section' on this page for the php driver installation and it all worked. Got the php drivers from github as mentioned in the page.
Later i copied the file mongo.so from the php file extensions directory running on my virtual machine to my parent os and it all works now!