Viewed   194 times

I need to use the extension intl on my mac with XAMPP.

So I have followed this links:

Php-intl installation on XAMPP for Mac Lion 10.8

http://lvarayut.blogspot.it/2013/09/installing-intl-extension-in-xampp.html

I restart always my apache server but isn't installed the extension. Because if I launch:

php -m | grep intl #should return 'intl'

return empty

The command that I can't launch without it is for composer and cakephp like this:

composer create-project --prefer-dist -s dev cakephp/app cakephp3

Return me this error:

Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for cakephp/cakephp 3.0.*-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
    - cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
  Problem 2
    - cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/bake dev-master requires cakephp/cakephp 3.0.x-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
    - Installation request for cakephp/bake dev-master -> satisfiable by cakephp/bake[dev-master].

So I need to solve the problem of ext-intl with the extension intl.

Can someone help me with this problem? How can I install this extension?

Thanks

 Answers

4

These below steps helped me, Just in case if you are using OSX

Steps from http://www.phpzce.com/blog/view/15/installing-intl-package-on-your-mac-with-xampp

  1. Check which php path is set i.e.

    root$: which php
    
  2. If you are using xampp on your mac it should be

    /Applications/XAMPP/xamppfiles/bin/php 
    

    but if its

    /usr/bin/php 
    

    you need to change your OSx php

    root$: PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}" 
    
  3. Install icu4c

    root$: brew install icu4c 
    
  4. Install Intl via PECL

    root$: sudo pecl update-channels 
    root$: sudo pecl install intl 
    
  5. You can check if Intl was installed successfully

    root$: php -m | grep intl #should return 'intl' 
    

Done

============================

Note:

  • From extensions list in /Applications/XAMPP/xamppfiles/etc/php.ini file Add / Uncomment extension=intl.so line. And restart Apache. Thanks @pazhyn

  • Before installing "intl" you have to install Autoconf if you have not installed it. Thanks @Digant

    • via Homebrew brew install autoconf automake or
    • by running below commands

      curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
      tar xzf autoconf-latest.tar.gz
      cd autoconf-*
      ./configure --prefix=/usr/local
      make
      sudo make install
      cd ..
      rm -r autoconf-*
      
Monday, December 19, 2022
4

I just ran this in Terminal.

sudo pecl install intl

Then just add

extension=intl.so

to php.ini.

Tuesday, November 8, 2022
 
nishi
 
4

When I installed FreeTDS I originally used MacPorts. I believe that this gave me some conflicts for where freetds.conf should have been. And even though the path for freetds.conf when running tsql -C was the actual path that I was attempting to use, when I compiled the mssql.so extension with that path PHP wouldn't recognize it.

The solution is to forget MacPorts for FreeTDS and just install FreeTDS from source. Then install the mssql.so extension from the PHP source and make sure you're using the same version that is on your system (mine was 5.3.13 under OS X Mountain Lion).

If you follow the instructions at this blog exactly you shouldn't have any issues.

A couple of final things:

  • I am NOT running MAMP even though the instructions mention it so it won't matter either way.
  • If you already did install FreeTDS via MacPorts, uninstall using: sudo port uninstall freetds +odbc and then sudo port uninstall unixODBC. Make sure you uninstall all instances of FreeTDS. If you have more than one, you'll get a notice when you run uninstall that you need to specify the version to uninstall.
Wednesday, August 10, 2022
1

Go ahead and download XAMPP, which is probably the most popular local environment for development.

Once it's installed, open the XAMPP Control Panel, and click "Manage Servers":

Start the Apache Web Server. Your computer is now running as a 'localhost environment'.

If you go to your browser and type localhost, you should be greeted by a orange "Welcome to XAMPP" page.

In Finder, navigate to Applications > XAMPP > xamppfiles > htdocs, which is where you "create your sites". For example: inside the htdocs directory, I would make a folder called test which inside would be my relevant HTML, CSS, PHP etc - if I now went in my browser to localhost/test, I would see that site just like I would if it was hosted online.


Feel free to ask any further questions.

Monday, September 26, 2022
 
4

Something like this should do the trick. It is not recently tested but should work to read the data you are looking for from a mp3 file.

function tagReader($file){
    $id3v23 = array("TIT2","TALB","TPE1","TRCK","TDRC","TLEN","USLT");
    $id3v22 = array("TT2","TAL","TP1","TRK","TYE","TLE","ULT");
    $fsize = filesize($file);
    $fd = fopen($file,"r");
    $tag = fread($fd,$fsize);
    $tmp = "";
    fclose($fd);
    if (substr($tag,0,3) == "ID3") {
        $result['FileName'] = $file;
        $result['TAG'] = substr($tag,0,3);
        $result['Version'] = hexdec(bin2hex(substr($tag,3,1))).".".hexdec(bin2hex(substr($tag,4,1)));
    }
    if($result['Version'] == "4.0" || $result['Version'] == "3.0"){
        for ($i=0;$i<count($id3v23);$i++){
            if (strpos($tag,$id3v23[$i].chr(0))!= FALSE){
                $pos = strpos($tag, $id3v23[$i].chr(0));
                $len = hexdec(bin2hex(substr($tag,($pos+5),3)));
                $data = substr($tag, $pos, 9+$len);
                for ($a=0;$a<strlen($data);$a++){
                    $char = substr($data,$a,1);
                    if($char >= " " && $char <= "~") $tmp.=$char;
                }
                if(substr($tmp,0,4) == "TIT2") $result['Title'] = substr($tmp,4);
                if(substr($tmp,0,4) == "TALB") $result['Album'] = substr($tmp,4);
                if(substr($tmp,0,4) == "TPE1") $result['Author'] = substr($tmp,4);
                if(substr($tmp,0,4) == "TRCK") $result['Track'] = substr($tmp,4);
                if(substr($tmp,0,4) == "TDRC") $result['Year'] = substr($tmp,4);
                if(substr($tmp,0,4) == "TLEN") $result['Lenght'] = substr($tmp,4);
                if(substr($tmp,0,4) == "USLT") $result['Lyric'] = substr($tmp,7);
                $tmp = "";
            }
        }
    }
    if($result['Version'] == "2.0"){
        for ($i=0;$i<count($id3v22);$i++){
            if (strpos($tag,$id3v22[$i].chr(0))!= FALSE){
                $pos = strpos($tag, $id3v22[$i].chr(0));
                $len = hexdec(bin2hex(substr($tag,($pos+3),3)));
                $data = substr($tag, $pos, 6+$len);
                for ($a=0;$a<strlen($data);$a++){
                    $char = substr($data,$a,1);
                    if($char >= " " && $char <= "~") $tmp.=$char;
                }
                if(substr($tmp,0,3) == "TT2") $result['Title'] = substr($tmp,3);
                if(substr($tmp,0,3) == "TAL") $result['Album'] = substr($tmp,3);
                if(substr($tmp,0,3) == "TP1") $result['Author'] = substr($tmp,3);
                if(substr($tmp,0,3) == "TRK") $result['Track'] = substr($tmp,3);
                if(substr($tmp,0,3) == "TYE") $result['Year'] = substr($tmp,3);
                if(substr($tmp,0,3) == "TLE") $result['Lenght'] = substr($tmp,3);
                if(substr($tmp,0,3) == "ULT") $result['Lyric'] = substr($tmp,6);
                $tmp = "";
            }
        }   
    }
    return $result;
}
Tuesday, December 6, 2022
 
osman
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :