Easiest Way to Activate PHP and MySQL on MAC Os 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion)

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

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

/etc/apache2/httpd.conf

Find the line:

"#LoadModule php5_module        libexec/apache2/libphp5.so"

And uncomment it (remove the #).

Download and install the latest MySQL version from mysql.com. 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.

Python MySQL On Mac OS X Lion

Turns out the newest MySql_python worked great. just had to run sudo python setup.py install

Automatically Start MySQL Server on Startup not working on Mac OS X 10.8

They've changed stuffs in mountain lion,
here is a guide for how making AMP work in your new envioroment
http://www.coolestguidesontheplanet.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion

If you only need the MySQL part, jump to that part :).

Where do I save my HTML and PHP files when I am using a local server on my Mac (OS X 10.6 Snow Leopard)

The main http://localhost/ webroot is at /MacHD/Library/WebServer/Documents

Your Sites folders will be accessible at http://localhost/~username/

If you install a new Apache or other webserver (e.g. via MacPorts, Fink, or some other method.) you'll need to refer to the documentation to discover the webroot, httpdocs & htdocs are common defaults.

Avoid using something like MAMP, if you actually prefer to know exactly what is on your system, if you don't care about the nuts and bolts, an all-in-one like that could be useful, YMMV.

InputManager plug-ins in Snow Leopard (OS X 10.6)

If you really need to inject code into applications to accomplish what you're trying to do, use mach_inject.

And please file a bug requesting hooks so you can implement your software in a safer way in future.

Install PECL on Mac OS X 10.6

Better late than never, but if you are like me and installed PHP directly from php.net (instead of using something like Homebrew or Port, then you can simply follow the following link to install Pear and PECL:

http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/

We need PEAR! For some reason, it's not set up ready to on Lion, but
the install phar file is here, so we just need to run it.

cd /usr/lib/php
sudo php install-pear-nozlib.phar

Edit:
/etc/php.ini and find the line: ;
include_path = ".:/php/includes"
and change it to:
include_path = ".:/usr/lib/php/pear"
sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade-all

It worked fine for me.



Related Topics



Leave a reply



Submit