sinckerop.blogg.se

Setting up mysql on mac
Setting up mysql on mac







  1. Setting up mysql on mac how to#
  2. Setting up mysql on mac mac osx#
  3. Setting up mysql on mac code#

Open up your text editor and create a file named after your “Home” folder. So lets go ahead and set it up so you can serve up files from your “Sites” folder. If you’re the curious type and tried to click on “Your personal website” in the Web Sharing panel you may have noticed that you were greeted with a “Forbidden” message. Great success! Setting up a personal website and virtual hosting Now type in your browser and you should see something like this: Save it in /Library/WebServer/Documents/ (start from the top level directory of your hard drive, not the Library directory in your home directory) with the name test.php. Now in your text editor create a PHP file and type the following code: Go back to the “Sharing” Preference Pane in System Preferences and click on the URL/ IP Address below “Your computer’s website.” If all goes well you’ll see a page that says “Test Page for Apache Installation.” You can also type in your browser which will take you to the same place. So now hopefully if everything has gone according to plan, we’ll see some fruits of our labor. You can use the above command or simply restart “Web Sharing” in System Preferences… it’s up to you. Keep in mind any editing you do to the nf or to the php.ini will require a restart of Apache. If you need to restart Apache, this will do the trick: You’ll be prompted for your system password. You can also use the following command the start Apache from Terminal: Kudos! To start up Apache click on the “Sharing” preference pane in System Preferences and enable “Web Sharing” like so: Our friends at Apple were kind enough to ship a very modern version of Apache 2.2.6 for our development work. You’ve now enabled PHP so lets move on to Apache. This creates your php.ini file, which is located in /etc/php.ini for your future reference. By default, Leopard has an empty configuration file but provides a file which can be used as a template. I won’t be covering any tweaks to that file in this article but you should be aware that it exists. All relevant PHP settings are in the php.ini file. I’ve never had any problems myself but it’s something to look out for.

Setting up mysql on mac code#

However if you need some of PHP’s extended features you may want to consider rebuilding PHP from source code as I’ve read the version that ships with Leopard has been problematic for some. All the most popular extensions are already activated so you should be good to go. PHP 5.2.6 is the version shipped with Leopard. Don’t be alarmed if it asks for your system password… this is normal.

setting up mysql on mac

LoadModule php5_module libexec/apache2/libphp5.so To enable PHP browse to Apache’s nf file located in /etc/apache2/nf You should now be able to see all hidden files. Then restart Finder by typing the following: You can also run this simple Terminal command to “show” all hidden folders in Finder:ĭefaults write AppleShowAllFiles TRUE I personally use Coda so all that you have to do is click on the “View” menu and choose Show Invisible Files, as illustrated below: If you use a text editor like Coda, BBedit, Text Wrangler, or TextMate you can choose to have hidden files “shown” so you can find them in your file structure. Most of the files we’ll be working with are actually hidden from Finder. It’s all pretty easy to do but requires a little attention to detail in parts.

Setting up mysql on mac how to#

I will outline how to do this as well as get MySQL up and running so you can have a local development setup right on your Mac!

setting up mysql on mac

By default both are inactive and require you to get them ready for business.

Setting up mysql on mac mac osx#

One of the best features for web developers in Mac OSX Leopard is the inclusion of PHP and Apache.

setting up mysql on mac

Posted 12 August 2008 by Mike Longmire & filed under Coding. Setting up PHP, MySQL, and Apache in Mac OSX Leopard









Setting up mysql on mac