Once that is done, we need to restart Apache (or whichever web server you are using) for the changes to take effect. Note that if you do not have a /etc/php.ini file, then you need to copy a default configuration file to this location with the following command. Now add the following to your /etc/php.ini configuration file: extension=intl.so When you are prompted for the location of ICU, simply enter /usr/local. Installing the PHP intl extensionįinally we are ready to actually install the PHP intl extension after having done the ground work! This is actually the easiest part. Note: The files will be extracted to a directory named after the version of autoconf that was downloaded and may therefore differ from the above. Now we need to install autoconf if you do not have it already. You can find other versions of ICU right here. If you are using OS X Mavericks, then it is important to use this particular version (or newer), as you will otherwise get the following errors when compiling: ld: 304 duplicate symbols for architecture x86_64Ĭlang: error: linker command failed with exit code 1 The first of the above commands downloads version 52.1 of ICU. Note that when building the library, you will see a bunch of warnings, but simply ignore these and carry on. Hence, we need to install this dependency. The PHP intl extension depends on the ICU library that provides globalization support for software applications. Now let us make sure that our PEAR and PECL channels are up to date. The date part differs in different versions of OS X. Note: Be sure to double-check the extensions directory as it may differ depending on your version of OS X (if you are not using OS X 10.9 Mavericks). Now you are ready to add the two lines to the PHP configuration file. Enter the following command to copy it to /etc/php.ini so that it will be loaded by PHP. A default php.ini file is shipped with OS X and is located at /etc/. If you do not have a /etc/php.ini file, then your PHP installation is using default settings. sudo vi /etc/php.ini or sudo nano /etc/php.ini. Otherwise you can use vim, nano or similar, e.g. ini files, you can simply enter open /etc/php.ini in the Terminal. If you have defined a default editor for. This information should be added to the /etc/php.ini file. Now we need to add PEAR to the include path and specify the directory where extensions should be installed. Issue the below commands in a Terminal window. Rather, Apple has provided a PHAR file for setting it all up. Fortunately, OS X ships with PECL and PEAR, although they are not enabled by default. We are eventually going to install the PHP intl extension with PECL, so we need to set this up so that we can fetch the extension from the repository. If you have already done this in the past, you can simply ignore this step. Press the “Install” button and follow the instructions. A popup dialog should be displayed with instructions on how to continue. Then open up a Terminal and enter the following: xcode-select –install. Begin by installing Xcode from the App Store if you do not have it installed already. Installing Xcodeįirst, we need to make sure that the Xcode Command Line Tools are installed. Some of the steps are different for other versions of OS X, such as how to install Xcode. Please also note that this article is intended for OS X 10.9 Mavericks. Please note that there are incredibly many ways to accomplish this, so this is merely my way of doing it. It has been tested on OS X Mavericks with the built-in installation of PHP, but may or may not work on other setups. This article will show you how to install the things you need by hand. It might be that a library that you are using depends upon the PHP intl extension – for instance, some validators in Zend Framework 2 do so. Sometimes one needs to use internationalization features in PHP.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |