Installing PHP OAuth in MAMP environment - php

I have tried following ALL tutorials out there on getting PHP OAuth extension installed under the MAMP environment, but can't get it to load for some reason.
I am using MAMP 1.9 with PHP 5.3.2
The most recent tutorial I was following was: http://lifeofadev.com/2011/03/09/mac-os-x-installing-oauth-so-into-xampp-mamp/
Does anyone else have experience with getting this to work?
Thanks!
Dennis

After upgrading to MAMP 2.0 for PHP 5.2.17 I followed these steps to install the oauth module through pecl
Download MAMP Server components and libraries Specifically you want php-5.2.17.tar.gz
Uncompress php-5.2.17.tar.gz to /Applications/MAMP/bin/php/php5.2.17/include/php
Run configure against the downloaded php. Do not build it.
cd /Applications/MAMP/bin/php/php5.2.17/include/php;
./configure
Remove broken pear config:
mv /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf.bak
Compile oauth
cd /Applications/MAMP/bin/php/php5.2.17/bin;
./pecl install oauth
Update php.ini and add extension=oauth.so This can be done in MAMP under File -> Edit Template -> PHP -> PHP 5.2.17 php.ini

For MAMP 3:
Download and install OAuth.
sudo pecl install oauth
Then, go to MAMP, and click on File > Edit Template > PHP > PHP 5.x.x php.ini and add the following line
extension = oauth.so
Make sure to choose the current running php version (or press CMD+4 to edit MAMP's running php.ini file).
Restart MAMP servers.

Since MAMP 3.0 sources are hard to find but you can download sources from PHP.net, make sure the version match : http://php.net/downloads.php, then follow Ryan instructions.

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?

Enable XML-RPC on Xampp

I'm working on a project and I need to connect to Odoo via XML-RPC. The documentation suggests using Ripcord library, and for this I need to enable XML-RPC on my enviroment, but I've got no clue how to do this. I've been googleing for the last couple of days but couldnt find answers on a similar setting that I could understand.
Im working on XAMPP for Mac, and the PHP version is 8.0
Thanks in advance.
You can try download xmlrpc extension in pecl website and install the compatible dll into your xampp.
Go to https://pecl.php.net/package/xmlrpc and download the dll
Copy the .dll file to your xampp/php/ext folder
Add this text to your php.ini
extension=php_xmlrpc.dll
Restart apache service
Done
You can try to install xmlrpc extension with following commands:
git clone https://git.php.net/repository/pecl/networking/xmlrpc.git
export CPPFLAGS=-I/usr/include/libxml2/
cd xmlrpc && phpize && ./configure --with-expat && make && make install
echo "extension=xmlrpc.so" > /etc/php/8.0/mods-available/xmlrpc.ini
That's how I installed it on my Ubuntu.
Also you can check this if you don't know how to compile extensions on OS X

How to Install pspell with MAMP

I use MAMP for local php development and recently needed to use php's pspell functions for a project. I found little help with this specific scenario (short of recompiling php, yuck) so this post explains how I got it done.
I am not positive but you may need xcode and xcode command line tools installed for this to work. This article might be helpful.
Install MacPorts if you don't have it already
Install aspell and the dictionary of your choice (I used "en"):
sudo port install aspell aspell-dict-en
note: for the next commands, you need to know the version of php you're running on MAMP. You can find this in the MAMP preferences under the PHP tab. For me it's 5.5.18
Download the php source for the version of php you are running,
unarchive it, and move into the pspell source directory:
cd ~/Downloads/php-5.5.18/ext/pspell
Now (being sure to use the proper phpize binary for your php version) do:
/Applications/MAMP/bin/php/php5.5.18/bin/phpize
You should see something like:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Next:
./configure --with-php-config=/Applications/MAMP/bin/php/php5.5.18/bin/php-config --with-pspell=/opt/local/
And finally, build the module file:
make
You should now have two files inside the ./modules/ directory: aspell.so and aspell.la - copy them into your php's extensions directory:
cp ./modules/* /Applications/MAMP/bin/php/php5.5.18/lib/php/extensions/no-debug-non-zts-20121212
Now add the extension to your configuration file in /Applications/MAMP/bin/php/php5.5.18/conf/php.ini
extension=pspell.so
Finally, restart your MAMP servers and (hopefully) you are good to go!

Trouble installing Oauth extension on MAMP PRO php version 5.3.27

I'm following the guide here (https://stackoverflow.com/a/7002008/1346932) to install the PHP OAuth extension in MAMP PRO (using version 2.2 of MAMP PRO and version 5.3.27 of PHP).
When I get to step 3 of the guide and try to run ./configure, I get the following error:
-bash: ./configure: No such file or directory
Any ideas how to get this to work?
Sounds like you are not inside the correct directory. This should work if you run these commands individually, like...
cd /Applications/MAMP/bin/php/php5.2.17/include/php
and then
./configure
This is of course assuming that you have unzipped the files into the same folder as in step 2.

Upgrading PHP 5.4.0 in XAMPP for Windows?

I want to upgrade to PHP 5.4.0 in XAMPP. I'm using windows operating system. I searched on web, but there was no proper guide for this as it was released recently.
Can anyone give me some instructions on how to upgrade to PHP 5.4.0 in XAMPP (windows)?
Download the latest binary version of PHP (make sure to get the .zip package not the installer)
De-archive it to a directory
Copy the contents of the directory in the php subfolder of your XAMPP installation directory, overwriting the files which are already present
Overwrite the files which are already present in the apache\bin directory with the newer versions.
Now the trick: take the files which have a "_2" in their names (for example php5apache2_2.dll or php5apache2_2_filter.dll), copy them in the apache\bin subdirectory and remove the "_2" part, overwriting the existing files. This is necessary because by XAMPP uses Apache version 2.2 and the files with the 2 prefix are built for Apache 2.0, so you must take the files build for the newer version (which has a different plugin interface) and rename them in the filenames XAMPP expects.
Source
I found a working php_uploadprogress.dll extension for xampp windows with php 5.4 here:
http://www.fsbcomputers.com/php_uploadprogress
there are 32 and 64 bit versions as well as a preview for php 5.5.
By the way, the php build numbers, apache /xampp refers to are:
PHP 5.2: 20060613
PHP 5.3: 20090626
PHP 5.4: 20100525
I hope that you are still following this, I installed php 5.4 on the latest xampp stable with no problem.
Fortunately for you, there is a beta update of xampp which makes life easier. http://www.apachefriends.org/en/xampp-beta.html
Just make sure to make a complete backup of your old xampp directory, and export your old databases so you can import them into your new (updated) mysql installation. Alternatively you do not need to update mysql, I use this beta and I can say that it's pretty solid.
EDIT: The pop-up warning were a problem that I had too, I recommend using the latest beta. But, you can fix the errors and use php 5.4 on your old install (not recommended) by commenting out the following line in php.ini
extension=php_oci8.dll
Change to
;extension=php_oci8.dll
I have done the upgrade in ubuntu. Following are the steps to do the upgrade.
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5
sudo /etc/init.d/apache2 restart

Categories