December 27, 2007

PHP & Mysql on Mac OSX

Now that have a running G4 tower that I can use as a server, all that is left is to set up the required items on it. My main goal is PHP and MYSQL so that I can start development on the next update to the PSU AMS groups website. From what I had learned from previous setups is that PHP is already installed in Mac OS 10.4, however it is not completely active. Luckily the process was very painless and straight forward. It also helped that I was not doing anything more then a simple setup.

I made the PHP setup a lot harder than it had to be and tried to build from the latest source. Sadly I did not have all of the required dependancy files for it and that quickly became a waist. Still it was a good idea to read the Apple developer page on PHP first here. Luckily someone had already made an installer for PHP, and I just had to find it at Entropy. It installed without any problems, just make sure to read the directions.

Mysql was next, just like PHP there was a handy installer for it. Apple's developer site has a great page on installing Mysql on Mac OS X here, that I started with. It boiled down to just get Mac installer from the Mysql site and install it. It also included a control panel for Mysql that I installed, it lets you set Mysql to start up on every time the computer is turned on.

One thing that was missing was the phpMyAdmin page for Mysql. I thought that it would be included, however after trying to get to lazurus.local~efeion/mysql, which is how I get to it from school, it quickly become apparent that was not the case. It is actually a separate project here. To make it similar to what I am use to using, after extracting the directory, I named it mysql and placed it in the sites folder in my directory. This is where apache is set to host websites by default, and is fine for what I am doing. Now if I went to lazurus.local/~efeion/mysql and the phpMyAdmin page would show up, but now complained about not being configured. Easiest way to fix that was to go to the mysql/scrips/setup.php page. This handy script will generate a config file for phpMyAdmin, just grab what it outputs and save it in a file called config.inc.php located in the main mysql folder. There is a sample version in that folder for the more advanced users to set up manually. However I am still new to this and did not want to dig that deep yet.

Now I had a PHP web server with a Mysql back end all set up, which was a lot easier than I expected.

No comments: