MAMP with php extension intl on osx - php

I need to setup a project base on CakePhp FW, so I need to enable intl extension.
I followed this tutorial , but I always get make: *** [php_intl.lo] Error 1 even though I created symbolic link between MAMP and the directory containing XCode php development headers by using this command (after excute I got file exist result)
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /Applications/MAMP/bin/php/php7.1.6
I am not familiar with MAC OS, so please help
System Info
OSX: High Sierra 10.13.4
MAMP Pro 4
PHP 7.1.6
If you need more info, please let me know

Related

having problem with installing PHP Debug extension in Virtual Studio Code on macOS

I'm trying to install the PHP Debug extension in Virtual Studio Code on macOS Ventura 13.1.
While following the instructions from https://xdebug.org/wizard, I am getting an error "Check for supported PHP versions...configure: error: not supported. Need a PHP version >= 7.2.0 and < 8.2.0 (found 8.2.0)" at step 6: Run ./configure
I have no problems installing PHP and Xdebug when I tried installing via homebrew outside of the VS Code app(followed instructions from https://xdebug.org/docs/install). When I typed php -v in terminal, it shows Xdebug version(3.2) and Zend OPcache v8.2.0.
I have tried copying xdebug.so module file from homebrew php app folder to AMPPS php app folder, configuring php.ini as the step 8 & 9 and reloading the AMPPS Apache web server. It still does not work, and I guess I need to run ./configure -> make to get proper xdebug.so file for AMPPS configuration settings.
UPDATE
I found the solution to use ./configure --with-php-config="path-to-AMPPS-php" but still having the problem of loading the Xdebug extension after reloading the web server.
Is there a way to use Xdebug with AMPPS and Virtual Studio Code together?

PHP OCI8 installation on mac sierra

Is anyone know how to install PHP OCI8 extension on macOS Sierra (10.12.6)? I tried to follow the steps given here http://www.enavigo.com/2012/01/04/enabling-oracle-oci8-php-extension-on-os-x-snow-leopard/ but stuck on the step where it says copy files under /usr/include folder. Looks like copying to that folder is not allowed in new OS version? I tried googling but didn't find any good answer. All answers are related to old OS versions. Any help would be really appreciated
The Instant Client installation instructions for macOS say you can link from ~/lib (as an alternative to /usr/local/lib).
Unzip the Instant Client Basic & SDK packages to ~/instantclient_12_1 and then run:
mkdir ~/lib
ln -s ~/instantclient_12_1/libclntsh.dylib ~/lib/
This is what I do: just one symbolic link to my local Instant Client directory.
Now you can build PHP and/or OCI8. If you are using PECL and PHP 7 you could run
pecl install oci8
and answer the prompt with:
instantclient,/Users/yourname/instantclient_12_1
Don't use something like $HOME, since pecl won't expand variables.
If you are building PHP yourself, your configure option could be something like:
configure --with-oci8=instantclient,$HOME/instantclient_12_1 . . .

PHP Imagick UwAmp installation not working

I've been browsing net few days, however I haven't find the solution to my problem yet. So here I am, asking my first stackoverflow question ever:
I need to install imagick to my UwAmp local server.
My current imagemagick version: ImageMagick-6.8.9-1-vc9-x86
I have Windows 7 x64, but neither x64 version of ImageMagick made my local server run the imagick. In command line, ImageMagick is working OK.
My PHP version: 5.4.31
The extension is listed in UwAmp list of extensions, but when i run PHPinfo there isn't a single word about imagick. My Apache error log doesn't print any error associated with loading problems.
When I run the test file, it prints out: Fatal error: Class 'imagick' not found.
I have tried bunch php_imagick.dll files for various versions of PHP, for x64 wamp server, for x86 one etc. The solutions I have found doesn't solve it. Neither do the step-by-step tutorials.
Have you experienced this problem so far? What php_imagick.dll file would you recommend me to try?
Thank you for you help, Michael
EDIT: my UwAmp version is 32 bit
Detailed guide for newbies like me.
Took a long time to get it to work.
I initially followed:
http://php.net/manual/en/imagick.installation.php
but after installation, PHPInfo under imagick shows
number of supported formats = 0
So I followed these steps, clobbered from various sources
to get it to work.
Click PHPInfo and check:
Architecture = x86 or x64
Thread Safety = yes or no
Download ImageMagick from:
http://windows.php.net/downloads/pecl/deps/
In my case I downloaded: ImageMagick-6.9.3-7-vc11-x86.zip
because the Architecture under PHPInfo is x86
as for vc11 or vc14
search google for "visual c++ 11 runtime" or
"visual c++ 14 runtime" and install it
Unzip and copy all dlls from the bin subfolder to the
Apache bin directory. It's a bunch of CORE_RL_.dll
and IM_MOD_RL_.dll plus a few other dlls.
In my case, I installed UwAmp in C:\UwAmp, so:
(from zip) bin/*.dll --> C:\UwAmp\bin\apache\bin
Goto:
http://pecl.php.net/package/imagick
as of today, latest is 3.4.1 so I went to:
http://pecl.php.net/package/imagick/3.4.1/windows
My PHP version is: 5.6.18, and Thread Safety is Yes from
Step #1, so I downloaded:
5.6 Thread Safe (TS) x86
and got: php_imagick-3.4.1-5.6-ts-vc11-x86.zip
Unzip and copy "php_imagick.dll" to the php extension folder:
In my case:
php_imagick.dll --> C:\UwAmp\bin\php\php-5.6.18\ext
Note: this ZIP also contains dlls which other guides says
to extract to the extension folder of apache.
NO NEED TO DO IT. Step #3 has taken care of it.
Edit "php.ini" and add:
extension=php_imagick.dll
or (I placed it at the very end):
[Imagick]
extension=php_imagick.dll
For super newbies: click the edit button in the UwAmp UI,
"php_uwamp.ini" will open and edit it. It will be copied to
the correct php.ini when UwAmp is restarted. I had
trouble at first since there are several php*.ini scattered
all over.
Restart Apache
Check PHPInfo
scroll to section (or find): imagick
number of supported formats: 234 (on mine)
If there is no "imagick" section or "supported format" is 0,
something went wrong.
Hope this helps.
BTW, the comment to the question by "Gras Double" works,
just wish I had found it earlier.

PHP mcrypt installing and setting up laravel environment issues

I am using Mac OS X Lion 10.7.5 and I want to clear one thing I do not want to use XAMPP, MAMP anymore.
So I enabled apache, php and installed mysql following this link. This work well. Then I downloaded laravel and installed it following this link. I copied laravel folder inside Sites folder which I created according to first link tutorial. Now when I click on public folder inside laravel folder it gives me following error
Unhandled Exception
Message:
Call to undefined function Laravel\mcrypt_create_iv()
Location:
/Users/zafarsaleem/Sites/learning-laravel/laravel/crypter.php on line 36
Then checked whether mcrypts are installed in phpinfo(). They are not there. To install mcrypt I followed this link. It worked until when I followed to PHP Extension title. When I downloaded PHP 5.3.8 is now the default since Mac OS X 10.7.3 unpacked and when I issue phpize command it gives me this error
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
What does this top level source directory of the module means? How can I make mcrypt install properly to make laravel work? Please help.
You will need to install Xcode and the command line tools extra package within Xcode, for then to install mcrypt
For more details, read this http://www.coolestguyplanettech.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/

Mongo PHP Driver 1.2.10 with MAMP

I'm trying to get the latest Mongo Driver to work with MAMP 1.9.6 on OS X 10.5.8.
I built it successfully from source since it seems that there are no pre-compiled releases, included it into the right directory and restarted the apache.
But PHP doesn't recognize the extension. I used the 1.0.11 driver previously which worked fine, but I need the new version, because Doctrines ODM requires it.
When I replace the 1.2.10 mongo.so with the 1.0.11 and restart apache mongo is available. I don't get what could be wrong.
Anyone had this behaviour or any guesses to get this to work?
Update: The PHP error log shows the following:
[01-Jun-2012 22:02:37] PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
I'm not quite sure what it means?
2. Update:
I was finally able to sync the API version of phpize.
But now I'm not able to build the driver anymore.
I do the following:
phpize
./configure
make
sudo make install
But at the make command I'm getting tons of syntax errors. Seems that it can't find several header files.
The very first one is the zend_config.h and really I just have those other two files:
zend_config.nw.h
zend_config.w32.h
I downloaded the MAMP components to get this files. Why am I missing this one? And there are a lot of others.
I'm using PHP 5.3.5 Is there a way to get those header files from a different source?
I followed the instructions at Develop MongoDB web apps with MAMP under Mac OS X to successfully build mongo.so for MAMP with php 5.3 on OS X 10.7.3.
I'm adding this for historical purposes -- I guarantee that if you're having the same set of problems, you'll want to do this.
Personally, I had a really difficult time getting MAMP's php version to play nicely with the extension builds that I was trying to make.
I discovered that the problem was that MAMP really hadn't been set up to add extensions in general, and during the compilation of the mongo php drivers, it wasn't installing it in the right place -- so I followed the following tutorial on preparing MAMP for additional pecl and pear extensions.
After following those steps to prepare MAMP for adding extensions, you can easily install any extension.
At the part where it starts talking about adding an extension, use sudo pecl install mongo and restart apache from your MAMP interface.
I ran into the same problem when upgrading from PHP 5.3 to 5.4 and was able to solve it by following these steps:
Make sure to upgrade php5-cli as well as just php5 and php5-common
Uninstall the mongo drive
sudo pecl uninstall mongo
Re-install the mongo driver
sudo pecl install mongo

Categories