Installing Drupal on Tiger

Much More than Blogging


Matt Willmore Skip to comments 64 Comments (Comments Closed Closed)

Matt Willmore teaches you the basics of getting the open source content management engine Drupal installed on your Mac running OS X 10.4 Tiger.

Here we are again. This week I'll cover how to install Drupal, a powerful open-source content management system (CMS) that's been around for some time, on Mac OS X 10.4 Tiger.

The cool thing about Drupal is its modular architecture, making it a very flexible web publishing platform. The most popular uses for Drupal so far are weblogs, community discussion (think Slashdot or Kuro5hin), collaboration, and overall content management. When used properly, Drupal can be a Swiss Army knife of web tools, whether you use it locally or on the Internet.

As nice as Drupal is, the purpose of this article is to detail how to install Drupal 4.6 on OS X 10.4. For more information on extending the use of Drupal, they maintain an extensive web site that you can look through and find your answer. Without further ado, here we go!

If you have installed another blog engine such as WordPress or Movable Type already, you may already have MySQL and/or PHP already configured. If this is the case, you can skip right down to step 4.

  1. Downloading and Installing Drupal v4.6
  2. Enabling Personal Web Sharing
  3. Downloading and Installing MySQL
  4. Configuring MySQL
  5. Enabling and Testing PHP
  6. Configuring Drupal

Downloading and Installing Drupal v4.6

Druplicon: The Drupal IconFirst let's get the Drupal software from the release page on Drupal's site. Download that puppy and let OS X decompress it. You will be left with the folder drupal-4.6.0. Now let's move it to the folder Apache will use to serve the pages. Open the folder /Library/WebServer/Documents and drop it right in there. This directory is the Apache's root directory, meaning if you place the folder in there, Drupal will be available via http://yoursite.com/drupal-4.6.0/.

Speaking of which, let's rename the folder to an easier name. Make it something clean like "drupal" or "blog". If you want Drupal to be THE site you get when you access your domain, you'll want to delete the contents of /Library/WebServer/Documents and move the contents of the Drupal folder into that directory. Easy enough, right?

Enabling Personal Web Sharing

"Personal Web Sharing" (PWS) is Apple's marketing name for Apache, the industrial-strength, tried-and-true web server du jour. When you enable PWS, OS X starts up Apache, registers the modules, opens ports, etc. Since we'll be serving the blog, we'll need to have Apache running.

To enable Personal Web Sharing, open the Sharing preference pane in System Preferences. Check the box labeled "Personal Web Sharing", and that's it. (You may have to authenticate as an administrator before it will let you enable anything.) Go ahead and close System Preferences; you're ready to install MySQL now.

Note: We are working on a version of this tutorial that includes the ability to host the database with SQLite, which is prepackaged in OS X 10.4. However, support for SQLite in Drupal is still being fully developed, so for now MySQL is still the way to go. If you'd like to see such an article, let us know.

Downloading and Installing MySQL

MySQL is the database backend that Drupal (and other blogging packages like Movable Type and WordPress) can use to store blog entries, users, comments, etc. MySQL is free for personal use. First, download MySQL (4.0.24 at the time of publication). It will come as disk image with two packages and a readme. We will be installing both packages. First, open the main MySQL installer. It will install all the necessary components to run MySQL onto your OS X volume. After that installer has completed, run the startup item installer, which will automatically start up MySQL after any computer restarts.

Note: One of the most common problems reported is that people install MySQL 4.1 instead of 4.0. I can understand the desire to be on the bleeding edge of software, but WordPress (and most other blog/CMS engines) use an older authentication scheme that is incompatible with MySQL 4.1 and greater. There are hacks and workarounds out there, but for the easiest installation, stick to MySQL 4.0.

Configuring MySQL

Now that you have installed MySQL, let's configure it so Drupal can access it. Open a new terminal session (found in /Applications/Utilities/Terminal.app) and type the following commands to navigate, make some changes, and start the MySQL daemon:

cd /usr/local/mysql
sudo chown -R mysql data/
sudo echo
sudo ./bin/mysqld_safe &

Next, let's launch MySQL and use the test database (called test, even) to make sure everything's running correctly:

/usr/local/mysql/bin/mysql test

If everything's running correctly, you should see output similar to this:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version 4.0.24-standard

Type 'help;' or '\h' for help.  Type '\c' to clear the buffer.

mysql>

Once you've verified that MySQL is running correctly, use the command quit to return to the console prompt.

Now that MySQL is running, we'll change the root password of MySQL so that Drupal (and you) can access it later. Use this command (where yourpasswordhere is replaced by your chosen password):

/usr/local/mysql/bin/mysqladmin -u root password yourpasswordhere

Unfortunately, Drupal isn't as cool as WordPress in the fact that it won't automatically populate your database. Although there are great MySQL GUI's available for OS X like CocoaMySQL, we'll live on the edge today and do it all in UNIX. To accomplish this, we'll create the database, and populate it with a MySQL dump included with Drupal:

/usr/local/mysql/bin/mysqladmin -u root -p create drupal
/usr/local/mysql/bin/mysql -u root -p drupal < /Library/WebServer/Documents/drupal/database/database.mysql

Enabling and Testing PHP

Now that MySQL is ready to go, let's fire up PHP. OS X ships with PHP installed, but not activated. Fortunately, this is really easy to do. The only file we'll need to edit is httpd.conf, which Apache uses for its configuration.

Open the config file in your favorite editor (I'll be using pico):

sudo pico /etc/httpd/httpd.conf

Mosey on down to the Dynamic Shared Object (DSO) Support section. It's the one with all the LoadModule listings. The one for PHP 4 is towards the bottom of that list. Look for the line and uncomment it to activate it. You can uncomment a line by removing the pound symbol ("#") from the beginning of the line. The new line should look as such:

LoadModule php4_module

We'll also need to uncomment the PHP 4 entry in the AddModule listings, so that it looks as such:

AddModule mod_php4.c

Once those two lines are edited you can save the httpd.conf file and quit the editor. Since we've edited Apache's load setup, we need to restart Apache so it will recognize the changes:

sudo apachectl graceful

With that out of the way, let's make sure that PHP is indeed running. Create a new text file in your favorite editor (stay away from RTF-happy TextEdit, though - SubEthaEdit gets my vote) and fill it with the following text:

<?php
phpinfo();
?>

Save the file as test.php in the root directory (/Library/WebServer/Documents/) and load the address of the page (usually http://localhost/test.php) into a web browser. If PHP was correctly enabled, the phpinfo(); command should output page after page about the PHP installation. If not, retrace your steps - it can be easy to make a mistake.

Configuring Drupal

Now it's time for some Drupal action. First off, let's edit the config file that specifies the path Drupal will use to access its MySQL database. Start this by editing /Library/WebServer/Documents/drupal/sites/default/settings.php. The string on line 81 should be formed as follows:

$db_url = "mysql://root:mysql_password@localhost/drupal";

...where mysql_password is the root password you chose for the MySQL databae, and drupal is the MySQL database table you created for Drupal. Next, go down to line 90 of the config file. You'll want to edit the default path to match where your Drupal installation is located - most likely http://localhost/drupal. It should look similar to this example:

$base_url = 'http://localhost/drupal';

Save the file, and you're ready to use Drupal online! Open a browser, and enter the following address: http://localhost/drupal/. The basic Drupal front page should come right up. Click the link to create an account - that will be the admin account.

The last thing we need to do is to edit OS X's contab file, which will periodically trigger a script that will, in turn, trigger modules to perform maintenance operations. To begin, open the crontab schedule file in UNIX:

sudo pico /etc/crontab

Enter your admin password when asked, and add the following line to the bottom:

   0    *   *   *   *   wget -O - -q http://localhost/drupal/cron.php

Note: In OS X 10.4, Apple has moved maintenance tasks traditionally in cron to their new launchd service, so your crontab will look unusally empty. Don't worry, though — cron still works just like always.

If it's not formatted correctly when you paste it in, format the line so that it matches up. The headers in the 10.4 distribution of cron are actually also messed up, so don't worry if it doesn't line up. Just make sure each character is spaced with tabs and you're good to go.

OS X 10.4 Screenshot of crontab with Drupal script

Save the file and exit. That's it!

Matt WillmoreMatt Willmore is a founding partner of MacZealots.com. Matt is also a Resident Assistant at Owen Hall and does Mac support at ECN, and is active in PUMUG. He can be reached at .

Reader Comments (64)

DISCLAIMER: The views expressed below are those of their authors and not necessarily endorsed or supported by MacZealots.com. In all cases, the comments provided here are offered as a courtesy and will be moderated. Any content deemed off-topic or offensive will be removed without notice. Posting a comment here boils down to two things: 1.) Think before you type 2.) Respect the thoughts of others. See our commenting guidelines and/or privacy policy for more information.

1 B鑽 Kessels remarks:
#1) On September 24, 2004 10:12 AM

mr Willmore,

A great article, although I must admit I did not read it thoroughly, because I do not have access to mac osx.

However, the point of this comment is to kindly request whether or not you think it possible to contribute this article on the drupal.org handbooks?
Or, in case you do not want ot contribute the article, maybe include a detailed summary oin the handbooks with a read more link to this specific page.
A bookpage with your (summary of the) manual on http://drupal.org/node/258 would be very welcome.

We, at Drupal, try too keep the resources central, that way users and developers always have only one place to start looking. This, for example in contrary to the *nuke communities where everything is hosted all over the internet.

2 Mike Cohen remarks:
#2) On September 24, 2004 10:57 AM

I’m running Drupal at MacMegasite and I’m very happy with it. I switched from PHP-Nuke, which is horribly written and less secure than Windows. When I was running Nuke it used to get hacked about once a week.

Drupal 4.5 is about to be released soon. If you want to keep up with the latest changes, you can use their CVS server. See http://drupal.org/node/320 for instructions to use CVS.

If you have themes or modules for 4.4.x, they’ll need to be rewritten for 4.5. The theme system has changed a lot and is now much more template driven.

3 phil shapiro remarks:
#3) On September 24, 2004 7:59 PM

thanks a megabyte, matt. this article is well written and useful. i was looking for something just like to get me started with drupal.

phil shapiro
http://www.his.com/pshapiro/

4 macgeek remarks:
#4) On September 24, 2004 10:20 PM

We’re also using Drupal over at Mac Geekery. Wonderful, wonderful software. Anything you can imagine can be done very easily. It’s a breeze to get installed in Mac OS X once PHP and MySQL are going, as well.

Themeing, as Mike said, is much different in CVS HEAD. The only problem I have with it is if you want logic you get to write your own PHP interface to your theme (yay). Bit if you just need simple substitutions, the included xtemplate system is great.

The only change I would make to this article would be the MySQL instructions. JC posted an article over on MG that mentions an official package installer for MySQL that’s out now and much easier to install than the binary, even for the “pro” users since it includes the Startup Item so that MySQL will automagically start after a reboot. :)

5 macgeek remarks:
#5) On September 25, 2004 3:44 AM

Strike that last bit; I skimmed the article where I should have read it. I saw the “safe_mysqld” bit and figured it was the binary package.

Once you’ve installed the Startup Item, just run “sudo SystemStarter start MySQL” to get it going.

6 Ken remarks:
#6) On October 4, 2004 8:36 PM

Good article. It may make things more confusing, but I’d go through the extra step of making a unique drupal user account rather than using root. It’s never too early to mention and reinforce a good security practice.

7 Cameron remarks:
#7) On October 20, 2004 5:25 PM

Thanks for the great instructions. My only problem is that Drupal seems to have the following error displayed in the webbrowser above the drupal content for, rougly, lines 42-70:

strict warning: var: Deprecated. Please use the public/private/protected modifiers in /Library/WebServer/Documents/drupal/themes/engines/xtemplate/xtemplate.inc on line 42.

Does anyone know of a way to solve this problem? What am I doing wrong?

8 Matt Willmore remarks:
#8) On October 21, 2004 3:35 PM

Cameron -

Are you by chance using PHP 5? It seems that this error only happens under PHP 5, although technically Drupal still “works”. The effort to make Drupal PHP 5-compliant is in progress, but not completed as of yet.

In the meantime, you can turn off strict warnings to avoid seeing this. To do that, navigate to the following place:

Your Drupal front page -> [log in as admin] -> Administer -> Settings -> Error reporting

Change this to “Write errors to the log”. Click “Save configuration” at the bottom, and you should be all set.

9 Derek remarks:
#9) On October 24, 2004 2:30 AM

Any tips on how to overcome this error:

Warning: mysql_connect(): Access denied for user: ‘drupal@localhost’ (Using password: YES) in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 12
Access denied for user: ‘drupal@localhost’ (Using password: YES)

I’m guessing it’s a password or permissions problem

10 Derek remarks:
#10) On October 24, 2004 2:39 AM

Quick follow up:

when I try to change the mysql password, I get this in terminal:

XXXXs-Computer:~ XXXX$ /usr/local/mysql/bin/mysqladmin -u root password yourpasswordhere
/usr/local/mysql/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user: ‘root@localhost’ (Using password: NO)’

Am I supposed to substitute a password of my choosing in this command line or use the phrase “yourpasswordhere”?

11 Derek remarks:
#11) On October 25, 2004 10:20 AM

forget my previous questions. I did a reinstall and managed to get Drupal running.

However, I did install PHP 5 (so I can run and test Moodle) but I can’t find the settings file you mention above to turn off error reporting: the option doesn’t seem to be available at the path you suggest…

Drupal front page -> [log in as admin] -> Administer -> Settings -> Error reporting

12 Matt Willmore remarks:
#12) On October 25, 2004 11:07 AM

Derek -

How far can you get in the path? I’ll try to better explain it.

Drupal front page (obvious - whatever/drupal)
Log in (blanks on left hand side by default) AS ADMIN USER
Administer link (left hand side again)
Settings (about 1/2 way down the list)
Error reporting (about 2/3 way down the page)

Make a little more sense? Sorry for the confusion.

13 James Lamberg remarks:
#13) On October 26, 2004 12:34 AM

Maybe I set this up wrong via your instructions, but when mail is sent off my computer via Drupal, it ends up looking like this:

From: MAILER-DAEMON@JAMES.local
Subject: Undelivered Mail Returned to Sender
Date: 25 October, 2004 23:32:07 CDT
To: username@domain.com

This is the Postfix program at host JAMES.local.

I’m sorry to have to inform you that the message returned
below could not be delivered to one or more destinations.

For further assistance, please send mail to

If you do so, please include this problem report. You can
delete your own text from the message returned below.

The Postfix program

: host mhub-w.tc.umn.edu[160.94.160.20] said: 553 5.1.8
… Domain of sender address does not exist (in reply to
MAIL FROM command)
Reporting-MTA: dns; JAMES.local
Arrival-Date: Mon, 25 Oct 2004 23:32:05 -0500 (CDT)

Final-Recipient: rfc822; username@domain.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host mhub-w.tc.umn.edu[160.94.160.20] said: 553
5.1.8 … Domain of sender address does not exist (in
reply to MAIL FROM command)
afafsd has applied for an account.
http://65.25.221.213/Drupal/?q=admin/user/edit/9

14 Randy remarks:
#14) On October 28, 2004 1:48 PM

Everything worked great on my install. I did have to install the wget package inorder to allow the crontab entry to work. The easiest way to install wget is with fink.

15 Randy remarks:
#15) On October 28, 2004 2:09 PM

In reponse to my previous post. Instead of installing wget you can use its replacement curl which is already available on OS X 10.3.x. In your /etc/crontab just add:

0 * * * * root curl -s http://localhost/cron.php

16 Cieran remarks:
#16) On November 7, 2004 4:07 PM

i did everything according to instructions
but when i try to reach http://localhost/drupal

it just says “Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.”

17 Matt Willmore remarks:
#17) On November 7, 2004 9:45 PM

Cier疣 -

That error, a “500” server error, is most likely caused by an incorrectly typed variable, like a username, password, or something like that. Also special characters like “=” or “?” in one of the variables might be tripping up Drupal. If those don’t work, we can keep trying. :)

18 Cieran remarks:
#18) On November 7, 2004 11:30 PM

After looking through all of the variables without finding anything wrong, i finally got it working after downgrading to mysql 4.0.22
Seems as if it was 4.1 that was causing all of my troubles.

cheers for the help anyhow mate

19 Cheryl Chase remarks:
#19) On November 9, 2004 10:36 AM

ServerLogistics (a hosting company based on OSX Server) offers a free download called “Complete MySQL” for OSX. I’ve used it for a couple of years (including with Drupal), and have found it pushbutton easy and troublefree. No command line configuration required, and it even adds a control panel item for MySQL.

http://serverlogistics.com/mysql.php

20 medicaldroid remarks:
#20) On November 14, 2004 1:46 AM

I’ve had some trouble setting up Drupal. I believe I followed the directions exactly as stated however I keep getting the following message:

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 31
Client does not support authentication protocol requested by server; consider upgrading MySQL client

I’ve tried re-nstalling multiple times. Is it because I am using MySQL 4.1.7? Any ideas as to what I am doing wrong? Thanks.

21 Matt Willmore remarks:
#21) On November 14, 2004 2:16 AM

Many people have experienced the same problems you have. Fortunately, the solution is simple. As is stated in the tutorial, you should be running MySQL 4.0.20, not a 4.1.x version. Install the 4.0.20 version over your current one, and you should be ready to go.

22 roberto h remarks:
#22) On November 26, 2004 6:43 PM

i am trying to install drupal and so far everything seems ok until trying to deal with the permissions(i do have mysql 4.020) and get the same error as medical droid. I have to say that i am trying to install the latest drupal 4.50 and the config file is different than what the tutorial explains. Any updates to the tutorial?

thanks

23 Matt Willmore remarks:
#23) On November 26, 2004 10:12 PM

Roberto -

The conf.php files for Drupal 4.42 and 4.5 are identical. The only difference is the version number at the top of each file - in fact, the v4.5 of Drupal is using an older version (1.32) than the v4.42 (1.32.2.1) of Drupal. Otherwise, the files are identical.

24 Ricardo Amador remarks:
#24) On November 28, 2004 12:42 AM

Regarding the error:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client

After reading:
http://www.jaharmi.com/2004/11/06#a1882

Based on the info provided on MySQL site:
http://dev.mysql.com/doc/mysql/en/Old_client.html

I solved it using:
SET PASSWORD FOR ‘some_user’@’some_host’ = OLD_PASSWORD(‘newpwd’);

25 alex remarks:
#25) On May 28, 2005 9:23 AM

great tutorials on this site… but they are all for users of Mac OSX Client…. any chance i can find the same tutorials, but for Mac OSX SERVER? (yes, there are significant differences). if the zealots don’t consider server tutorials a worthy subject, can anybody point me to similar CMS tutorials, but for OSXserver? thanks!

26 Deano remarks:
#26) On May 29, 2005 4:38 AM

Indeed, we’d love to see OS X Server advice… For one thing, Tiger pre-installs MySQL 4.1.10a… Which apparently is a huge problem…

Little help???

27 Deano remarks:
#27) On May 29, 2005 4:39 PM

Alright… So, the Drupal on 4.1 thing is no big deal, apparently, just an auth issue, for which there is a fix (listed above in Ricardo Amador’s comment).

However, on OS X Server, there are a few persistent issues/nightmares across all services… Namely, if you upgraded to 10.4 from 10.3, a LOT of permissions need to be changed, and changed manually. I got the mysql errors to go away by chmodding my directories too liberally, until I can determine what Apple has gone and done this time. ;)

But, the 10.4 server instructions don’t really vary all that much. Instead of DLing and installing Mysql, just go to the Server folder in Applications, run Mysql Manager, and ‘install/turn on’ mysql. PHP should be running by default, and you can turn the module on if not from the Server Admin app (under the Web item/pane). Follow these instructions for the Drupal stuff, making sure to also ADD A DRUPAL USER to mysql, because running as the mysql root user is stupid! Instructions for that are… Around, everywhere. ;) Then change the password to use OLD_PASSWORD in mysql (see above), and you should be golden. If you still get errors, it means that the ownership/perms on your drupal or /var/mysql folders are messed up somehow.

I’ll try this install again on a ‘fresh’ 10.4 server box, and see if I can’t make actual instructions that suck less than these.

28 Syaman remarks:
#28) On May 30, 2005 6:56 AM

Thanks for the detailed instructions - I’ve successfully set up MySQL and also Drupal 4.6 on my Mac using them. :)

However, I am getting the following error messages when I go into Administer—>Settings in Drupal:

  • The directory files is not writable.
  • The built-in GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see http://php.net/image.

Will appreciate any advice, thanks.

29 anne remarks:
#29) On May 30, 2005 2:08 PM

thank you for this really nice written article - i really thought this time i would manage to use this terrible unknown object that terminal is to me.. but h駘as.. no way. it tells me things like:

G5:/usr/local/mysql anne$ sudo chown -R mysql data/

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

Password:

after giving my password it come sup with this:
G5:/usr/local/mysql anne$ -bash: sudo./bin/mysqld_safe: No such file or directory

then once again i do not know what i am doing in this app, so i give up finally. where do i find a tut for absolute idiots like me???

desperately going home now. huhuhuh..

30 Matt Willmore remarks:
#30) On May 30, 2005 2:45 PM

Syaman -

I solved the files directory error by changing the owner to www, group to admin, and permissions to 755 (owner can do everything, group can read/execute, and world can read/execute. Here’s the commands I used to make that happen (this is assuming that my Drupal directory is located at /Library/WebServer/Documents/drupal/):

    cd /Library/WebServer/Documents/Drupal
    sudo chown www:admin files
    sudo chmod 755 files

That should take care of the first error. As for the GD library error, I realized that you will have to recompile PHP to include the library. If you want to do this, Apple has instructions written on compiling PHP on OS X, and specifically shows how to compile with GD support:

http://developer.apple.com/internet/opensource/php.html

31 Matt Willmore remarks:
#31) On May 30, 2005 3:00 PM

Anne -

To fix that, you need to make sure you have a space between “sudo” and “./bin/mysqld_safe &”. The line should look exactly as such:

    sudo ./bin/mysqld_safe &
32 anne remarks:
#32) On June 8, 2005 7:15 AM

hi matt,

thanks again for your personal support but it seems not to be ok so far.. what does all that mean..?? tried several times:

G5:/usr/local/mysql anne$ sudo ./bin/mysqld_safe &
1 492
G5:/usr/local/mysql anne$ Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/G5.local.pid
050608 13:11:10 mysqld ended

/usr/local/mysql/bin/mysql test
ERROR 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
1+ Done sudo ./bin/mysqld_safe
G5:/usr/local/mysql anne$

sorry.. — i think i’m not too talented for databases.. thanks for your help, matt.

33 anne remarks:
#33) On June 8, 2005 12:35 PM

hi again,

although i do not know exactly what i’m talking about |:|-( i just come from apple-website where i am told that the directory of mysql is /usr/bin/ ? is that may be new for panther and tiger?? or am i too confused..? i am surely because i think that now i have two msyql versions running and i do not know how to stop the activating at startup of the computer..??? prefpane of complete mysql doesn’t work either..

34 brian huculak remarks:
#34) On June 14, 2005 10:49 AM

great article, thanks.

Having reviewed the article a few times and trying the install several times I consistently hit a wall.

When confirming my php installation (test.php) - the file is rendered to the browser as plain text vs the detailed info. In reviewing the httpd.conf file, it correctly lists the LoadModule and AddModule have comment # removed and the file is saved and Apache successfully restarted.

The fact it lists the test.php file as plain text seems to indicate that php isn’t running in apache but I’m at a loss as to where to look to correct the problem. Same condition holds true if I try to load the Drupal index.php page - only renders as plain text.

Mac OS X 10.4.1
MySQL 4.0.24
Drupal 4.6.1.

I tried searching drupal.org but came up empty - any insights are appreciated.

Thanks
Huc
Brian Huculak

35 Jeff remarks:
#35) On June 16, 2005 1:13 PM

I was able to manage my site: http://www.sledgetch.com due to practicing on my local machine via your instructions for wordpress. Now, I’m playing with drupal to see how I like that, again, due to your great instructions. There are none better that I could find that not only show you the commands, and explain what you are doing coherently. I am NOT a unix guy bu I can follow simplified directions and that is what you have provided. What a great service you have done! Thanks!

36 brian huculak remarks:
#36) On June 16, 2005 7:59 PM

A followup to my own post: Problem where test.php was only loading as plain text

I added these two lines to httpd.conf file and now the test.php file loads correctly

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

now onto dealing with Drupal ;-)

Cheers
huc

37 Matt Willmore remarks:
#37) On June 20, 2005 10:03 AM

Anne -

The version of MySQL that you install from the MySQL web site (which is what I use in the tutorial) is installed in /usr/local/. To check to see how many versions of the MySQL process you have running, you can use the Activity Monitor application (in Applications > Utilities).

38 jt remarks:
#38) On June 20, 2005 10:36 AM

I am trying to test drupal, I had it running, but now I can’t. Here’s my error message upon browsing to http://localhost/drupal: (mysql 4.0.x)

Fatal error: Table ‘drupal.users’ doesn’t exist query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = ‘e1dd8deef3299ccdb70923b7f9f249e0’ AND u.status (mysql 4.0.x)

Fatal error: Table ‘drupal.users’ doesn’t exist query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = ‘e1dd8deef3299ccdb70923b7f9f249e0’ AND u.status < 3 LIMIT 0, 1 in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 66

39 jt remarks:
#39) On June 20, 2005 10:59 AM

Got it…hey, folks….it really helps when you follow directions to the letter…sorry.

40 Reid Young remarks:
#40) On June 22, 2005 11:29 AM

Matt - fantastic tutorial, I’ve probably referenced/recommended this thing to 5 or 6 people by now. Imagine my surprise when, while I was signing up for basecamp a minute ago, I saw Justin and his MacZealots case study, and then saw that all of you guys are from Purdue, and that I somehow don’t know any of you (I’m in CGT, graduating in December). I guess thats what I get for not joining PUMUG yet, although I only just recently purchased a Powerbook.

Anyway, great article, its helped me a lot with my personal stuff, and I’m sure we over at openBook (openbooktech.com) will be referencing this site pretty frequently if/when we decide to make the switch over to Apple products for our business lease.

Thanks again!

41 Mika remarks:
#41) On June 22, 2005 6:49 PM

Fatal error: Table ‘drupal.users’ doesn’t exist query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = ‘f3bba6519c151817e6a3d52043924a36’ AND u.status Fatal error: Table ‘drupal.users’ doesn’t exist query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = ‘f3bba6519c151817e6a3d52043924a36’ AND u.status < 3 LIMIT 0, 1 in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 66

Not getting this… what should I do? Drupal 4.6.1 cant get pass this… please help, and tell me how to manage this drupal stuff if it’s put online? I was exitet when I first saw drupal, but ow.. my exsitment is waaring down :( Unfortunatlly I don’t have much time to mess with MySQL.. any help is more the welcomed & THX!

42 shorty114 remarks:
#42) On June 28, 2005 5:52 AM

Very, very well written article. As I have dealt with Drupal minimally before, I recognized many of the steps you went thoroughly through. Very clear instructions, this site will definately be my source for OS X tutorials.

Again, very nice article.

43 Matt Willmore remarks:
#43) On July 11, 2005 5:41 PM

Mika -

This is most likely because the Drupal tables have not been imported. Try going back to the last step under “Configuring MySQL” and see if you have any luck.

44 craig hughes remarks:
#44) On July 15, 2005 1:27 PM

ok, so i already had mySQL 4.1 on my box before reading this article. I tried to down-install to 4.0, but the installer said “There is nothing to install”

Do I need to get rid of mySql 4.1 before I try to install 4.0? I’m no unix, mac, or terminal guru. I just want to set drupal up on my mac. If I stick with 4.1, where do I go to add that fix, and what exactly am I supposed to do? Thanks!

45 Shlomo remarks:
#45) On July 21, 2005 8:14 PM

I cannot login as admin because i get this error. Wht do i Do?

$db_url = “mysql://root:mysql_password@localhost/drupal”;
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /Library/WebServer/Documents/drupal/sites/default/settings.php:2) in /Library/WebServer/Documents/drupal/includes/session.inc on line 10

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /Library/WebServer/Documents/drupal/sites/default/settings.php:2) in /Library/WebServer/Documents/drupal/includes/session.inc on line 10
warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/drupal/sites/default/settings.php:2) in /Library/WebServer/Documents/drupal/includes/common.inc on line 99

46 Shlomo remarks:
#46) On July 22, 2005 7:14 PM

I have read and followed http://maczealots.com/tutorials/drupal/ and the drupal site for mac osx tiger and get this error when entering http://localhost/drupal/

$db_url = “mysql://root:mysql_password@localhost/drupal”;
Warning: mysql_connect(): Access denied for user: ‘root@localhost’ (Using password: YES) in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 31
Access denied for user: ‘root@localhost’ (Using password: YES)

what do i do?

47 Matt Willmore remarks:
#47) On July 25, 2005 1:48 AM

Craig -

It is possible to tell MySQL 4.1 to use the older 4.0-style password authentication scheme by feeding this command to the MySQL prompt:

mysql> SET PASSWORD FOR -> ‘root’@’localhost’ = OLD_PASSWORD(‘password’);

where “password” is your MySQL root password.

Alternatively, you can erase MySQL 4.1 and start over using a script from Marc Liyanage over at entropy.ch:

http://www.entropy.ch/software/macosx/mysql/remove-old-mysql.html

48 Matt Willmore remarks:
#48) On July 25, 2005 1:55 AM

Shlomo -

This error is most likely due to extra carriage returns at the end of the includes/conf.php file. Open the file with pico or a text editor (NOT TextEdit) and remove any additional carriage returns you find at the end of the file. This seems to fix the problem for the majority of the people who encounter this problem.

49 Matt Willmore remarks:
#49) On July 25, 2005 1:59 AM

Shlomo -

This error (“Access denied for user: ‘root@localhost’ (Using password: YES)”)is most likely due to a typo in your includes/conf.php. Providing that the steps to set up MySQL were followed correctly and you can log into MySQL with the root password you set and get a MySQL prompt, a typo in the conf.php file is the most likely culprit, specifically the $db_url setting.

50 leo fish remarks:
#50) On August 24, 2005 11:30 PM

Hey there,

excellent article and thanks so much. Nicely presented, easy to follow.

PHP is installed, mySQL 4.0 (not 4.1) is installed and appears installed correctly as well.
On the final step, I get this? (was on 10.3 and upgraded to 10.4).

Fatal error: Table ‘drupal.users’ doesn’t exist query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = ‘1cbb35fb44893422b392f07906e4e5d1’ AND u.status Hey there,

excellent article and thanks so much. Nicely presented, easy to follow.

PHP is installed, mySQL 4.0 (not 4.1) is installed and appears installed correctly as well.
On the final step, I get this? (was on 10.3 and upgraded to 10.4).

Fatal error: Table ‘drupal.users’ doesn’t exist query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = ‘1cbb35fb44893422b392f07906e4e5d1’ AND u.status < 3 LIMIT 0, 1 in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 66

also, i do agree that setting up config as ‘root’ is not good and do agree with the poster above about changing that.

Any help would be greatlt appreciated. Thank you and keep up the excellent work

51 leo fish remarks:
#51) On August 25, 2005 1:25 AM

ignore my last post.

i failed to successfully populate and load the database via this properly:

/usr/local/mysql/bin/mysql -u root -p drupal ignore my last post.

i failed to successfully populate and load the database via this properly:

/usr/local/mysql/bin/mysql -u root -p drupal < /Library/WebServer/Documents/drupal/database/database.mysql

it now works. if you see the message i got above, it means you didn’t load/populate. duh!

I am also using cocoaMySql as well (nice!)

52 vjyoyo remarks:
#52) On September 23, 2005 6:08 AM

Hi:

I’m trying to install drupal version 4.6.3 on a Tiger server.
After following some articles opn how to I get this message trying to open in the browser:

Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) in /Library/WebServer/Documents/drupal-4.6.3/includes/database.mysql.inc on line 31
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

Can anyone help me?

Thanks!

53 Matt Willmore remarks:
#53) On September 24, 2005 2:19 AM

Vjyoyo -

First, I would double- and triple-check your database settings to make sure nothing is misspelled. If those are correct, then the error indicates that the MySQL daemon is not running. You’ll need to re-run the “Configuring MySQL” steps in the tutorial.

54 Jim Greenleaf remarks:
#54) On September 28, 2005 1:49 AM

I followed your instructions just fine, and have a working Drupal installation. Great work.

However, I’m curious about how to backup the mysql database. You have any suggestions?

Thanks.

55 Martin Saleteg remarks:
#55) On October 16, 2005 4:42 AM

I had the same problem as several of you people installing MySQL 4.1.X with Wordpress/Drupal. What you need to do is the following:

1. Change the /etc/php.ini file to point to the correct mysql socket. In my case, the socket is located at /opt/local/var/run/mysqld/mysqld.sock - Thus I put this in /etc/php.ini :

mysql.default_socket = /opt/local/var/run/mysqld/mysqld.sock

2. Change the password behavior of mysql to use the old authentication hash method. I run the databases as root user (development system on my powerbook).

mysql> SET PASSWORD FOR ‘root’@’localhost’ = OLD_PASSWORD(‘password’);

This should be all that is needed to get mysql + php + drupal/wp to talk to eachother correctly.

56 edzard Kolks remarks:
#56) On November 10, 2005 6:31 PM

Hello,

Thanks for the tutorial. I did everything you did and got the same error as above with the
“Client does not support authentication protocol”. When I try to update the password with the command: SET PASSWORD FOR ‘root’@’localhost’ = OLD_PASSWORD(‘drupal’);
I get the message: Access denied for user ”@’localhost’ to database ‘mysql’

Do you know what I do wrong?

Best Regards,

Edzard

57 adam remarks:
#57) On December 14, 2005 12:53 PM

I’m having a problem with the password issue…

mysql> set password for
-> root@localhost = old_password(drupal);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘drupal)’ at line 2

Im using mysql 5….

58 Bernie remarks:
#58) On December 15, 2005 12:20 PM

Hi Adam,

I believe I’ve just overcome the same problem as you. Here’s what I did:

i went to /Library/Receipts and deleted the previous mySql installations (version 5)that were in that folder.

I could then run the installer to install version 4.0.20! (it would usually tell me that ‘There was nothing to install’ before i did this.)

Hope this helps.

59 Gisle Birkeland remarks:
#59) On December 17, 2005 12:10 PM

I’m having a hard time reseting my Apache server. The message I get after typing “sudo apachectl graceful” is this:

configuration broken, ignoring restart
(run ‘apachectl configtest’ for details)

Can someone help me out with this one?

Thanks alot!

60 Lars C. Pedersen remarks:
#60) On January 25, 2006 6:23 AM

Hi, Matt!

I must thank you loads and loads for putting up this excellent tutorial, it helped me out bigtime!! Im a newbee to this, and this was just so informative :-)

However, I keep getting this message when trying to edit the settings on the administrator menu:

The directory files does not exist.

This, along with the GD error is displayed. However, Iエll leave the GD error message for now but I just dont get why I dont have the directory files on my computer? How can I find them or make them?

Thanks,
Lars

61 ClintDogg remarks:
#61) On February 14, 2006 1:45 PM

Matt,

Wonderful article… well-written….

I hate to do this, but I have a ?

My install looks good… Everything step-by-step worked well… no errors….HOWEVER,

Trying to hit my site http://localhost/drupal I get a blank page - no errors - just complete blank.

MySQL is running & there is a drupal database which I can view in CocoaMySql.
PHP is running because I get the test.php to show fine
Apache (OSX Web Server) is working because I can view http://localhost

Any ideas?
Suggestions?

Thanks,

Clintdogg

62 Brigoli remarks:
#62) On March 10, 2006 1:52 AM

Has anyone tried installing Drupal with MAMP? I tried installing it but just like Clintdogg, I get a blank page when I hit http://localhost/drupal?

63 Jeff Evans remarks:
#63) On March 20, 2006 12:21 AM

Can I import and iCal .ics file and have Drupal serve it up?

64 Iden remarks:
#64) On March 20, 2006 6:12 PM

I know this was asked before but I’ve run into the same problem and checked the suggested solution.
I’ve got mySql 4.0.17 and Drupal 4.6.6 which I’d like to get running on OS X 10.4.5
When I try to connect to http://localhost/drupal I get :

Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2) in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 31
Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2)

I’ve been through the spellings and quotation marks on my drupal/sites/default/settings.php file and I have verified that mySql is operating because I am able to login as root in a terminal window and query the drupal database.



1) What do I need to set to get past the mysql connect error?

2) Do I need to stop mysqld and restart it somehow and if so how?