Install mbstring under Mac

Source: Internet
Author: User

Write php a query module today, you need to read a piece of content from the database, but not too much. As long as the intercept part can, so think of using mb_substr function, but found not support this function, so go online to find tutorials,

Found in Http://stackoverflow.com/questions/4787403/missing-mbstring-php-extension-when-installing-phpmyadmin-on-mac


Minor note-if You has installed a different version of PHP (like php5.5) you must install the correct version of the MB String package. In my case:

sudo port install php55-mbstring

To activate, you had to have the a line like this in your php.ini file:

extension=mbstring.so

Which comes from:

/opt/local/var/db/php55/mbstring.ini

(If you use the default macports install root).


Again to http://www.xuebuyuan.com/358034.html and http://www.ccvita.com/434.html find:


Under the Mac in addition to use DMG, pkg to install software, more convenient also useful macports to help you install other applications, and BSD in the same ports. MacPorts, like Apt-get and Yum, can quickly install some software.

The installation and usage of MacPorts are recorded here for your reference.

Visit the official website http://www.macports.org/install.php, here is provided with DMG installation and source installation two ways, DMG said more, download macports-1.9.2-10.6-snowleopard.dmg, next step to install.

Installing MacPorts via Source

wget http://distfiles.macports.org/MacPorts/MacPorts-1.9.2.tar.gz
Tar zxvf macports-1.9.2.tar.gz
CD MacPorts-1.9.2
./configure && make && sudo make install
Cd.. /
RM-RF macports-1.9.2*
/opt/local/bin and/opt/local/sbin are then added to the $path search path
Edit the/etc/profile file, plus
Export Path=/opt/local/bin: $PATH
Export Path=/opt/local/sbin: $PATH

MacPorts use
Updating the ports tree and MacPorts versions, it is highly recommended to use the-v parameter for the first run, showing the detailed update process.
sudo port-v selfupdate

Software in the search index
Port Search Name

Install new software
sudo port install name

Uninstalling software
sudo port uninstall name

Check for updated software and versions
Port outdated

Upgrade software that can be updated
sudo port upgrade outdated

Eclipse plug-in needs subclipse need Javahl, below through MacPorts to install
sudo port install subversion-javahlbindings



And


MacPorts similar to Apt-get and Yum and other package management tools, can easily install and uninstall software functions, but also can automatically install software dependencies, very convenient, similar to brew and other tools.

1. Download and install

Download MacPorts installation package or source code, I prefer to install the source code, using the APK installation is slow, and the progress of the grasp is not obvious, the total sense of the program is dead.

Download and installation can refer to Http://www.macports.org/install.php's introduction.

Select the MacPorts of the corresponding system version on the website, use the Copy link function of the browser and use wget to download.

wget Https://distfiles.macports.org/MacPorts/MacPorts-2.1.2.tar.gztar zxvf macports-2.1.2.tar.gzcd MacPorts-2.1.2. /configuremake && sudo make installcd. RM-RF macports-2.1.2*  # #删除源码

This is the ports command you can see in Ls/opt/local/bin.

Add/opt/local/bin and/opt/local/sbin to the $path find path

Export path= $PATH:/opt/local/binexport path= $PATH:/opt/local/sbin/

You can put the above code in the/etc/profile, then the $PATH environment variable will be set automatically every time the computer starts.

2. MacPorts use (detailed information can be referred to man Port manual page)

After installing this way, you will find that you still cannot install the software because the local and server software tree is not synchronized.

sudo port-v selfupdate

Synchronize local and global software trees, if necessary, while upgrading Mac port yourself. The-v parameter is used to show the detailed update process, not too anxious, the time may be very long.

Port Search Name

Search for the software name, if you want to download a dpkg, you can see the specific name of the package by Port search DPK (when you may not remember the package name), and you can download

sudo port install name

After you find a specific package through port search, you can install it via port install, which automatically detects dependencies and installs during installation

sudo port uninstall name

Uninstalling software

sudo port outdated

Check for updated software and versions

sudo port upgrade outdated

Upgrade software that can be updated

Port List

List all currently available software, or use the search command if you want to find the software you want.

Port Info Name

To view the package details

Port Deps Name

View the dependencies of a package

Port Clean--all Name

Remove some zero-bit files that are generated during package installation

Port Dependents Name

See which software is dependent on this software. When deleting a software, it is best to execute this command first.


Php-m can be used to view the module, modified the/etc/profile file to the source under this file to function

Install mbstring under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.