Asked  7 Months ago    Answers:  5   Viewed   33 times

What is the easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion)?

I'd prefer to use any bundled versions before resorting to downloading from the PHP or MySQL websites. That also rules out MAMP and similar.

I'm comfortable at the command line in Terminal.



Open a good text editor (I'd recommend TextMate, but the free TextWrangler or vi or nano will do too), and open:


Find the line:

"#LoadModule php5_module        libexec/apache2/"

And uncomment it (remove the #).

Download and install the latest MySQL version from Choose the x86_64 version for Intel (unless your Intel Mac is the original Macbook Pro or Macbook, which are not 64 bit chips. In those cases, use the 32 bit x86 version).

Install all the MySQL components. Using the pref pane, start MySQL.

In the Sharing System Pref, turn on (or if it was already on, turn off/on) Web Sharing.

You should now have Apache/PHP/MySQL running.

In 10.4 and 10.5 it was necessary to modify the php.ini file to point to the correct location of mysql.sock. There are reports that this is fixed in 10.6, but that doesn't appear to be the case for all of us, given some of the comments below.

Wednesday, March 31, 2021
answered 7 Months ago
41 refers to libmysqlclient.16.dylib. That is, the shared library that serves as the bridge between Python and the MySQL client library,, refers to the dynamic library for the MySQL client library, and that library cannot be loaded for some reason.

Questions you need to answer:

  • Is there a libmysqlclient.16.dylib anywhere on your system? If not, you need to install the MySQL client software.
  • If so, is the directory containing that library in your DYLD_LIBRARY_PATH setting? If not, try adding it.
  • If so, you'll have to ensure that the libmysqlclient.16.dylib file is not corrupt. My copy, installed in /opt/local/lib/mysql5/mysql/libmysqlclient.16.dylib, courtesy of MacPorts, has MD5 signature c79ee91af08057dfc269ee212915801a and is 1,462,376 bytes in size. What does your copy look like?
Tuesday, June 15, 2021
answered 5 Months ago

The answer is no, at least using the provided installer. The installer reports 10.6 is not found on any of my volumes and refuses to install.

Saturday, July 31, 2021
Bruno Reis
answered 3 Months ago

Follow these instructions to find the location of any package:

whereis ant (replace 'ant' with whatever you're looking for)

On my machine, this reports:


so, I do:

ls -l /usr/bin/ant

on my machine this reports:

lrwxr-xr-x  1 root  wheel  22 Nov 30 17:09 /usr/bin/ant -> /usr/share/ant/bin/ant

so, I do :

ls -l /usr/share/ant 

and get:

lrwxr-xr-x  1 root  wheel  14 Nov 30 17:09 /usr/share/ant -> java/ant-1.8.1

from this I can surmise that ant is installed at /usr/share/ant/java/ant-1.8.1

Monday, September 6, 2021
answered 2 Months ago

It turns out that NI-VISA 5.0 works well on 10.6.6.

The issue I was having was when calling pyVisa's visa.Instrument("GPIB::1") it said the library was not found. However when calling visa.get_instruments_list() displayed my GPIB adapter as GPIB0. Using this as the device I was able to connect properly.

There were a few changes that I had to make that were not documented well on NI's site (that I could find at least) in order to accomplish this. The most important being the name of the VISA library that NI-VISA 5.0 installs. It is found at /Library/Frameworks/Visa.framework/VISA. I have not tried modifying the nsi file to automatically link to this library as the pyVisa documentation mentions.

I have been unable to install pyvisa with pip. I had to use easy_install. If anyone has had success installing pyvisa with pip, I would really like to know how!

System Settings:

Python 2.7 running virutalenv + virtualenvwrapper. Snow Leopard 10.6.6. NI-VISA 5.0

Sample Code:

from pyvisa.vpp43 import visa_library
import visa
visa.get_instruments_list() # Yields: ['ASRL1', 'ASRL2', 'ASRL3', 'ASRL4', 'GPIB0::1']
temp = visa.Instrument("GPIB0::1")
print temp # Yeilds: Instrument("GPIB0::1::INSTR")

After moving to Lion I have found the same issues and have had to load the library manually each time. This makes me think I'm missing something.

Saturday, October 2, 2021
answered 3 Weeks ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :