Navigate into the new directory and prepare for compiling. Next we’ll download and extract the extension’s source with the following two commands: wget In this case, temp in the user’s home folder. Open up Terminal and browse to whatever directory you want temp files to be located in. Restart the MAMP servers and away you go! The Long Way Around extension=uploadprogress.soĪssuming you get no errors, that’s it. pecl install uploadprogressĪnd then add the extension to the php.ini file. Open up Terminal and start by doing a channel update for either PEAR or PECL (in this case, PECL): pecl channel-update They both do basically the same thing, but if you have issues with one, try the other. There are two ways to install an extension: the shortcut and the full version. Pecl config-set php_ini /Applications/MAMP/bin/php/php5.3.6/conf/php.ini Then just run these two commands (adjusting depending on where your php.ini is located): pear config-set php_ini /Applications/MAMP/bin/php/php5.3.6/conf/php.ini You can find this by going to your MAMP installation’s phpInfo page – – and looking at the “Loaded Configuration File”. ~/.profileĪnd now we tell pear and pecl where our php.ini file is. Now we just need to get Terminal to read in the new path variable. We can change this pretty easily (again, adjust the path if necessary to that it points to your version of PHP): echo "export PATH=/Applications/MAMP/bin/php/php5.3.6/bin:$PATH" > ~/.profile Now that we have everything in place, we need to use the MAMP installation of PHP rather than the default OS X installation. It’ll build and run checks and eventually you’ll get a License and a thank you notice and you’ll get a new command prompt. cd /Applications/MAMP/bin/php/php5.3.6/include/php You might have to adjust it if your MAMP installation or version of PHP is different. Now go to Terminal and use the following command to navigate to the folder we copied. Providing the PHP sourceĪssuming you’ve already installed MAMP (it has an installer package, so it’s pretty easy), you’ll need to download the MAMP Server components and libraries from the MAMP Downloads page (under the heading “Source code”). If, however, you’re using MAMP, then you’ll need to configure it to be able to install your extensions. If you use OS X’s built in PHP server, you probably don’t need to go through this next part. I had to do this on one of my machines to get things working. If you’re seeing a whole lot of “command not found” style errors on screen, you might need to open the script in a text editor and enter each line individually. Once it’s done check the last few lines that have printed to the Terminal window. Once it’s done Terminal will display “Installation complete.” and throw you a new command prompt. This will download and install all the tools included in the script. Open terminal and then simply run the following command (you might need to type in an administrator’s password at some stage): sh ~/cltools.sh I took that and turned it into a shell script that you can run with terminal.ĭownload the script from GitHub, then unzip it and move it into your home folder. Fortunately, I managed to find a blog post that included a useful script which does all the heavy lifting. There are a few tools that we need which aren’t included in Apple’s little package. Once it’s done, open up the disk image and run the installer package. Find the latest version of Command Line Tools for your version of OS X on that page and download them. If you don’t have Xcode, you first need to download the tools from the Downloads for Apple Developers page (you’ll need to register as an Apple Developer if you haven’t already). Close Xcode and move on to the next step. It’ll take a couple of minutes or whatever, but then it’s done. If you have Xcode, installation is as simple as opening up Xcode, going into the Downloads pane of the Preferences, selecting components and installing “Command Line Tools”. Regardless of whatever that previous sentence will have you believe, you don’t actually require Xcode to install them. Install Command Line Toolsįirst up we need to install the Command Line Tools that usually come with Xcode. So both to assist those who come after me, and also to remind me when I have to go through this again, here’s what I did. The combination made it a little more difficult to install extensions than I would have liked (though I am a bit of a command line n00b, so I guess there’s that). My development environment is MAMP ( not the PRO version), which I’m running on OS X Mountain Lion. One thing that had kept me from doing it until now was that I didn’t have the required extension installed in my development environment. This last weekend, I decided to knuckle down and build an OAuth server in PHP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |