i know it is a repeated question but did not find answer to my problem. I am trying to install gearman on windows using this link. I am stuck where it asks to ./configure gearman. In the latest versions of gearman, there is no configure file so this tutorial is not of use anymore. Solution i got after quite some research that i need to run phpize to create its configure file. And now i can not run phpize command on my system. it says command not found. Please help me if i can get this extension dll file or any other way i can run this.
Thanks
Related
it seems like a little bit stupid question, but Google for one hour and cannot find it:
How to install php on macOS via brew and use in in shell.
Install is simple (if you have brew already installed):
brew install php
But after installation, when i use php -v i still see default php on mac os and not the brew's one. Shoud I Add brew php binary into PATH, bash profile, or what?
Thank you!
homebrew creates symbolic links in /usr/local/bin to pretty much every binary it installs. So the answer to your question is to add that to your path in your login profile. That will probably be $HOME/.profile and you can add a line like:
export PATH=/usr/local/bin:$PATH
Then it will be set each time you login or open a new Terminal.
So in my case, the trouble was with some access permissions on specific folders on my Mac OS, so just sharing what I learned: if it's not working, carefully examile log / error feed, there can be a hint for you!
On April 1, 2018 Homebrew discontinued the Homebrew/php tap and went with a core install approach, which means many of the extensions now must be installed with PECL. I have written a two part blog series to help with installing Apache and PHP w/ PECL on later versions of MacOS. You can find it at the link below, I hope it helps!
https://medium.com/#crmcmullen/how-to-install-php-on-macos-10-13-high-sierra-and-10-14-mojave-using-homebrew-and-pecl-ef2276db3d62
Step 1: Install Homebrew
The first step is to install Homebrew and this is a tool (package manager for macOS) that will allow us to install easily PHP and basically any other package/tools.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step 2: Install PHP
To install PHP we can use the command below. The first command will automatically install the latest version of PHP which is at the current moment of writing this post version 8.
brew install php
If other versions may be preferred we can specify the PHP version and the code will look like the following.
brew install php#7.4
Step 3: The php.ini Config
The default PHP configuration should be sufficient to get started but if there are any other configurations, we can change them through the php.ini located on this path. Do note the PHP version number which in this case is version 8.
/usr/local/etc/php/8.1/php.ini
Step 4: Check if PHP is running
To check if PHP is already running we can make use of the brew services command. First, we can list the services that we have installed.
brew services list
If PHP is not started we can then run the command below to start the service in the background.
brew services start php#8.1
Step 5: Checking PHP Version
Lastly to check the PHP version do run:
php -v
By now you will have PHP running on the background process and every time you logged in to the system it will start by default. Thanks for reading and have a good try.
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 . . .
Hi i'm really having a hard time here,
I'm trying to install gearman job/task queue. I'm using windows, wappstack to be exact, then followed exactly the instructions here, and so far so good. I think I've installed the gearman server.
But I can't seem to find how to actually install PECL extension for gearman. I mean I can't find any .dlls to add to the PHP ext folder. and the PECL Package here just makes me all the more clueless. I can't invoke Gearman classes, and when I use phpinfo(); , gearman extension is just not present. I'm absolutely clueless on this.
How do I add and properly set up gearman extension to my PHP? Please and Thank you!
To you install a extensions of PECL you need use the cmd.
Open the cmd.
Go to directory where is the PHP program.
Find for "pecl.exe"
Install gearman extension.
Like:
$ cd C:/BitNami/wappstack-[version]/php/
$ pecl install gearman
Now, looking for the "php_gearman.dll" in the extension directory.
And add extension to php.ini
http://php.net/manual/en/install.windows.extensions.php
http://php.net/manual/en/install.pecl.php
I am trying to install the mcrypt PHP extension on my OS X Mountain Lion 10.8 operating system. This OS comes shipped with Apache and PHP already installed. The mcrypt extension however does not come shipped with PHP. I want to install mcrypt into the version of PHP that came shipped with my machine.
I do not want to use Homebrew, Macports, or any similar package manager, and I do not want to install another version of PHP in addition to the one I already have. I just want to plug mcrypt into the PHP that came bunded with my OS. I feel like this makes sense, instead of having multiple versions of the same program installed, yet every tutorial I come across seems to all immediately say to use Homebrew/Macports, and the few that don't teach you how to install a new PHP instead of using the one I already have.
I started following the directions laid out on this page: http://www.coolestguyplanettech.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/.
I downloaded libmcrypt-2.5.8.tar.gz from Sourceforge.
I extracted the contents with the following command: tar -zxvf libmcrypt-2.5.8.tar.gz.
I entered the libmcrypt-2.5.8 directory that was created and issued the following commands: ./configure, make, and sudo make install.
Now that tutorial says to go into a directory that was created by a new, non-native version of PHP that the tutorial tells you to install, not the native version that came shipped with OS X. The tutorial says to go into the following directory: cd ../php-5.3.13/ext/mcrypt/ (which is a directory I don't have), and run the phpize command. I can't go into that directory because I'm using the native PHP that came with OS X, so instead I go into the libmcrypt-2.5.8 directory, but when I try to run the phpize command I get an error that says: Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module. I do however have the files acinclude.m4 and aclocal.m4 in this directory. I am not sure if they are related to the config.m4 that phpize is looking for.
I am not sure how to proceed. Maybe I should just cut my losses and install another PHP using Macports or Homebrew, but I'd really prefer to use the native PHP that came bundled with OS X. Can you help me figure out how to do this? It would really help me a lot, and help me understand better how PHP and extensions work. Thank you!
"I'd really prefer to use the native PHP that came bundled with OS X.
Can you help me figure out how to do this? It would really help me a
lot, and help me understand better how PHP and extensions work."
The PHP that came bundled with OSX isn't any more "Native" than any other version that you would install.
You don't have that directory because, IIRC, OSX doesn't ship with PHP source, just a compiled binary and apache module.
You can only run phpize on a php extension, which you can get in the PHP source download (including the mcrypt extension). What you downloaded is the C library (which you may also need to install) that the PHP extension will reference (you don't need to worry about how this happens).
If you want to just install that extension:
Download it
Extract and cd into
sudo phpize
sudo ./configure && sudo make && sudo make install
Add extension=mcrypt.so (or whatever is generated) to your php config / php.ini and restart apache
This sounds to me like a good opportunity to learn more about how your computer works. This is some documentation I wrote for myself a few years ago on how to do this:
http://www.calvinfroedge.com/common-php-compile-configuration-options/ (note that the formatting in the blog might not work if you paste it into terminal, for example –with-mysql should be --with-mysql)
Besides, you don't need to get rid of your PHP installation that came with OSX. You can download the PHP source to a brand new directory, compile it, backup the old binary, and either symlink the result of 'which php' to your new installation or add the binaries that get generated after you compile to your source.
As the title states I am having some issues when installing gearman for PHP in a MAMP environment. Here's what I've done so far:
I've downloaded the latest PECL version and run these commands based on the docs:
tar xzf gearman-X.Y.tgz
cd gearman-X.Y
phpize
./configure
make
make install
I get to the phpize step and receive the error configure: error: Please install libgearman
I'm very new to Mac products, terminal/command line execution, etc. Can anyone help me work this? I can't really find any help on the issue when Googling.
You need to compile gearman daemon even if you are not running gearman on that machine. That will provide libgearman which you will use for the pecl gearman extension.
You can get gearman here: https://launchpad.net/gearmand/