Mar 9, 2010

Install Bugzilla on Mac Pro or MacBook Pro Running OS X 10.5 Leopard or 10.6 Snow Leopard

NOTE: I've added a troubleshooting section at the very bottom to address additional problems I encounter. If you have trouble with installation, check there for great tips.

Bugzilla on a Mac? Installing it shouldn't have been so hard. I guess it wasn't "hard," it was just really, really tedious. Almost, a "throw your laptop out the window" kind of tedious. I should know: I did it twice (installation, that is--not PC homicide). It felt like getting in line for the most crowded ride at Disney, waiting for hours to get to the front, only to arrive and realize it's NOT the front AT ALL--it's just a corner!! And once you turn it, 60 more minutes of wait time smack you in the face!

I guess that's why they invented the "FastPass." Well, lucky for us, each time I installed Bugzilla (on a MacBook Pro and a Mac Pro), I took meticulous notes, which I've summarized, below. Enjoy your FastPass to Bugzilla on a mac:

NOTE: I'd like to credit the blog I followed at Circles of Archimedes titled Installing Bugzilla on Mac OS X Server. It was, by far, the clearest, simplest, most accurate blog I could find on this topic. However, it is geared toward OS X Server and I have a Mac Pro running standard Leopard. Thereby, several steps were different. Much different.

Bugzilla on a Mac/MacBook Pro
(Leopard/Snow Leopard)

These are the exact steps I took to get it to work (twice). Basically, I had to:

then pass out from sleep deprivation. Exact details follow.

Download & Unpack

  1. Download the latest stable release of Bugzilla here
  2. Double click the archive file ("bugzilla-3.6.tar.gz" in my case) to unzip/untar it
  3. Move the resulting directory ("bugzilla-3.6" in my case) to /usr/local
  4. Create a symlink in /usr/local
    sudo ln -s bugzilla-3.6 bugzilla
  5. Create symlink in /usr/bin pointing to /usr/local/bugzilla
    cd /usr/bin; sudo ln -s /usr/local/bugzilla bugzilla
  6. Do the same in the Apache document root
    cd /Library/WebServer/Documents; sudo ln -s /usr/local/bugzilla bugzilla


Now it's time to get Perl situated. I'm not a perl guy, so I make no assumptions about your perl knowledge. Just do everything below and it should work.

Identify What's Missing

  1. Run the Bugzilla script to check your Perl setup
  2. cd /Library/WebServer/Documents/bugzilla; sudo ./ --check-modules
  3. Scroll down until you get to a section that looks like this
  4. YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database you use): PostgreSQL: /usr/bin/perl DBD::Pg MySQL: /usr/bin/perl DBD::mysql Oracle: /usr/bin/perl DBD::Oracle COMMANDS TO INSTALL REQUIRED MODULES (You *must* run all these commands and then re-run /usr/bin/perl DateTime::TimeZone /usr/bin/perl Template /usr/bin/perl Email::Send /usr/bin/perl Email::MIME /usr/bin/perl Email::MIME::Encodings /usr/bin/perl Email::MIME::Modifier

Essentially, these are all the problems (dependencies) you must fix before the bugzilla Perl code can function. I used CPAN to get that done. This is MUCH easier than typing the commands listed above because 1) CPAN exists, natively, on the Mac and 2) it takes care of all the stupid dependencies of dependencies for you! I'm not a Perl guy so maybe there are better ways to do this. All I know is, this worked (twice):

Install Missing Modules

  1. Run CPAN (from an administrator account)
  2. sudo CPAN
  3. If this is your first time using CPAN on your machine, walk through all the configuration options.
  4. The defaults work well. So most times, you can just press enter to select the default option. Toward the end, they'll ask you questions and tell you what the "Typical frequently used setting" is. Generally, I went with their suggestion. For example, when it said:

    Parameters for the 'make install' command?
    Typical frequently used setting:
    UNINST=1         to always uninstall potentially conflicting files
    Your choice:  []

    I typed in "UNINST=1"

  5. When you reach the end, it will prompt the following:
  6. Please enter your CPAN site: []

    After some Googling, I chose a few sites from the mirror list at to accomplish that I...

    • chose my country and "Show Mirrors" on the side
    • searched for , -5 to find all instances of my timezone
    • grabbed a couple mirrors... used the HTTP sites too, for fun

    This was my output in that section:

    Please enter your CPAN site: []
    Enter another URL or RETURN to quit: []
    Enter another URL or RETURN to quit: []
    Enter another URL or RETURN to quit: []
    Enter another URL or RETURN to quit: []
    New set of picks:
  7. Once CPAN is ready to go, you can begin installing the Perl modules by executing the commands in the section titled, "COMMANDS TO INSTALL REQUIRED MODULES." For example, my commands were
  8. install DateTime::TimeZone
    install Template
    install Email::Send
    install Email::MIME

    Note that the last command took care of the other Email dependencies I needed!

  9. After those commands are done, choose a database (we use MySQL) and install it's module
  10. install DBD::mysql
  11. Exit CPAN and re-run the check setup script(step #7, above) to verify that you addressed all required commands
  12. Rejoice, you're almost done!


This is the part I was telling you about, where it feels like you're at the end of the line . . . only to realize, you've got a ways to go. Next up, is the Apache & MySQL stuff.

One site I read somewhere mentioned that, briefly, Apache will be vulnerable while modifying some of these settings. Ideally, you should turn off your web server, first (sytem preferences -> sharing -> enable web sharing checkbox)--or better yet, disconnect from the internet entirely.

Admittedly, I did neither. I guess I'm a rebel.

  1. Modify your bugzilla localconfig file *NOTE: it seems this file isn't created until passes
  2. edit:
    - set $webservergoup = '_www'
    - set $db_pass = 'yourPassword'
    Obviously, replace 'yourPassword' with a valid password for the 'bugs' user.
  3. Change the owner on all your bugzilla files and symlinks
  4. sudo chown -R _www:_www /Library/WebServer/Documents/bugzilla
    sudo chown -R _www:_www /usr/local/bugzilla-3.6
    sudo chown -R _www:_www /usr/local/bugzilla
  5. Edit your Apache config file
  6. edit:
    add the following after the closing tag for <Directory "/Library/WebServer/Documents"> (after <Directory>):
    # Bugzilla
    <Directory "Library/WebServer/Documents/bugzilla">
    AddHandler cgi-script .cgi
    Options +Indexes +ExecCGI +FollowSymLinks
    DirectoryIndex index.cgi
    AllowOverride Limit
  7. Note that the +FollowSymLinks option needs to be set for this to work.
  8. Also, I had to do something funky to get CGI pages to stop loading as text. I don't have that documented but I believe it's just the +ExecCGI Option, above. I may have needed to load this module in the "LoadModule" section near the top:
  9. LoadModule cgi_module libexec/apache2/


Now comes the fun with MySQL. Basically, all you need to do is create the bugs database, create the bugs user (with the proper password). Of course, I assume you already have MySQL (if not, follow this post to install MySQL on Mac OS X). Then do the following to configure the bugzilla database:

  1. Run the following SQL (or copy it to a file named bugzilla.sql and run: mysql -u root -p < bugzilla.sql)
  2. use mysql;
    create database if not exists bugs;
    CREATE USER 'bugs'@'localhost' identified by 'yourPassword';
    CREATE USER 'bugs'@'' identified by 'yourPassword';
    CREATE USER 'bugs'@'%' identified by 'yourPassword';
    GRANT ALL PRIVILEGES ON bugs.* TO 'bugs'@'localhost' WITH GRANT OPTION;

Obviously, replace 'yourPassword' with a valid password for the 'bugs' user on the database. Also, granting ALL privileges is, of course, probably NOT the best thing to do . . . feel free to restrict the privilages on localhost if you like. I just wanted to be sure it would work. Plus, our DB is only connected to our intranet. Likewise, you don't need to grant privileges to all domains (i.e. the line containing 'bugs'@'%' could be omitted).

Home Stretch

Now that all this is set, and your bugs database has GRANT privileges, run the script (as administrator) :

sudo /usr/local/bugzilla/

Once Perl is completely setup, this script sets up your Database tables & data and applies a few other settings. There will be several prompts to respond to but all the answers are straight-forward. Be sure to TAKE NOTE OF WHAT YOU SET YOUR EMAIL/PASS TO! (I forgot mine and it was a hassle)

Bugzilla Settings

By now, all the difficult things are done. The only thing left is to run Bugzilla. So, fire up Apache (sytem preferences -> sharing -> enable web sharing checkbox) and visit the bugzilla directory on your server (for me it's, http://our.server.address/bugzilla) and celebrate!

From there, login at the top and begin setting the required paramaters (namely, urlbase). Here's a quick list of some of the things I typically change on every installation:

  • Required Settings > urlbase > http://our.server.address/bugzilla
  • Bug Fields > usebugaliases > On
  • Bug Fields > defaultpriority > Normal
  • Bug Fields > defaultseverity > Normal
  • Bug Fields > defaultplatform > Macintosh
  • Bug Fields > defaultopsys > Mac OS
  • User Matching > confirmuniqueusermatch > Off


Ok. So we upgraded our server to Snow Leopard and, somehow, that impacted the Perl environment thereby messing up Bugzilla. In the process of fixing this issue, I hit SO MANY roadblocks that it prompted me to add this Troubleshooting section--just for my own sanity.

Below, I will organize the bugzilla problems I encountered into Problem/Symptom/Solution sections and link each topic below:



Installation of Email::MIME module failed


received the following error:

make test had returned bad status, won't install without force


The suggestion at the bottom of this forum post recommended running
force install Email::MIME
which, in fact, did forcefully install the module. Whether that's good or bad, I can't say. I did continue looking for the root problem (which was, basically, to find and install all missing modules).


Problem description: Perl. That's it, just Perl. Perl + Bugzilla = headache

Jokes aside, every issue I've had installing Bugzilla always boils down to deducing the missing Perl module and installing it. Installation is easy. It's the "figuring out which module" part that will get you, every time!


received errors during Perl configuration such as:

#   Failed test 'use Email::Send;'
#   at t/foreign-mailer.t line 7.
#     Tried to use 'Email::Send'.
#    Error:  Can't locate Email/ in @INC ... 
BEGIN failed--compilation aborted at ...
#     Error:  Attempt to reload Email/ aborted.
#     Error:  Base class package "Email::Simple::Creator" is


The best process I've found for solving most bugzilla installation errors is:
  1. Open a fresh terminal window
  2. Attempt to install every module required in the "" script. (run the commands in step 4, above.)
  3. Execute every installation command once, ignoring any errors
  4. Copy all output into a file
  5. I used CPAN, which has it's own shell and thereby wouldn't let me pipe output into a file. So I just chose "Select All > Copy" in that fresh terminal window (in step 1) and pasted it into a temporary file
  6. Grep the file to sift out text related to missing modules
  7. They often generate errors along the lines of

    Error:  Can't locate Email/ in @INC (@INC contains ...

    So I used some variation of the following:
    cat tempFile.txt | grep @INC | awk -F"@" '{ print $1 }' which takes the file, pulls out every line with "@INC" in it, then lazily uses awk to split each line around the "@" symbol and print the first segment. This produced crude information on missing modules such as:
    t/19local-win32......Can't locate Params/ in 
    t/20local-subclass......Can't locate Params/ in 
    t/abstract-msg.......Can't locate Email/ in 
    #     Error:  Can't locate Email/ in 
    t/classic............Can't locate Email/ in 
    t/email-send-test....Can't locate Email/ in 
  8. Identify statements in a form similar to:

  9. Install the corresponding modules:
    sudo CPAN
    install Params::Validate
    install Email::Simple
    install Email::Date::Format
  10. Rerun the installation commands
  11. Run the script again to verify that the required modules no longer appear in the list
  12. Celebrate!
Typically, this process fixes the problem. I go over the initial output (the temp file created in step 3) with a fine-toothed comb and install everything that seems to be missing. The list above contains everything I installed this time, except YAML (for that just run: install YAML).


General errors that mention "DateTime" or "Locale"


errors such as:

Attempt to reload aborted
BEGIN failed--compilation aborted at /usr/local/share/perl/
5.10.0/DateTime/Locale/ line 8.
Compilation failed in require at /usr/local/share/perl/5.10.0/
DateTime/ line 10.
BEGIN failed--compilation aborted at /usr/local/share/perl/
5.10.0/DateTime/ line 10.
Compilation failed in require at lib/i486-linux-gnu-thread-
multi/ line 46.
BEGIN failed--compilation aborted at lib/i486-linux-gnu-thread
-multi/ line 46.


Many users on this forum found it helpful to run

install DateTime::Locale


install DBD::mysql fails


running the command generates the following error:

Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.014.tar.gz
  Has already been unwrapped into directory /Users/svn/.cpan/
  '/usr/bin/perl Makefile.PL' returned status 512, won't make
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install


Verify that the command "mysql" works from the terminal. If not, install mysql. Verify that you can connect to mysql as user "root." If not, grant permissions to your root account.


You need to re-run the initial CPAN setup wizard, for whatever reason (maybe to reset your URL mirror sites)


None the URLs you have seem to work, or maybe there's one that needs deleting (in my setup the first one would fail and take like 3 minutes to timeout).

Perhaps, you don't trust your CPAN installation settings and you want to rule that out during troubleshooting (I wanted to rule this out)


Re-run the initial CPAN setup with the folowing command (note: the first character is an 'o' -- not a bullet):
o conf init
To choose new URLs (or edit existing ones) run:
o conf init urllist
Be sure to commit your configuration after making changes. I believe the command is:
o conf commit


Need to reset bugzilla admin password


The admin password is lost or forgotten

The admin login credentials are lost or fogotten

Another admin account needs to be added (but you can't login)


This forum post provides lots of help on recovering a forgotten admin password or account.

There are several ways to address this issue

  • run with the --make-admin option:
  • ./
  • copy the profiles.cryptpassword for a known user account to the administrator account, OR add your account to the admin group:
  • SELECT @myusr := userid FROM profiles WHERE login_name="PUT YOUR EMAIL HERE"; 
    SELECT @admin := id FROM groups WHERE name="admin"; 
    INSERT INTO user_group_map (user_id,group_id,isbless,grant_type) VALUES 
  • Throw your computer out the window
  • That fixes everything.


Installing DateTime fails with an error mentioning "Singleton"


Errors such as:
  • t/37local-add.t ......... Can't locate Class/ in @INC (@INC contains: /Users/svn/.cpan/build/DateTime-0.55-ilncRa/blib/lib /Users/svn/.cpan/build/DateTime-0.55-ilncRa/blib/arch /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /Library/Perl/5.10.0/DateTime/TimeZone/America/ line 14.
  • BEGIN failed--compilation aborted at /Library/Perl/5.10.0/DateTime/TimeZone/America/ line 14.
  • t/38local-subtract.t .... Can't locate Class/ in @INC (@INC contains: /Users/svn/.cpan/build/DateTime-0.55-ilncRa/blib/lib /Users/svn/.cpan/build/DateTime-0.55-ilncRa/blib/arch /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /Library/Perl/5.10.0/DateTime/TimeZone/America/ line 14.
  • BEGIN failed--compilation aborted at /Library/Perl/5.10.0/DateTime/TimeZone/America/ line 14.
  • Compilation failed in require at (eval 906) line 3.
  • t/41cldr_format.t ....... Can't locate Class/ in @INC (@INC contains: /Users/svn/.cpan/build/DateTime-0.55-ilncRa/blib/lib /Users/svn/.cpan/build/DateTime-0.55-ilncRa/blib/arch /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /Library/Perl/5.10.0/DateTime/TimeZone/America/ line 14.
  • Result: FAIL
  • Failed 11/43 test programs. 3/2864 subtests failed.


The Singleton module is missing. For me, this also meant that the DateTime::TimeZone module hadn't been installed (because it depends on Singleton). To solve this, either
  • execute install DateTime::TimeZone
  • and choose [yes] when prompted about the Unsatisfied dependency on Singleton. This will automatically install the missing Singleton module.


  • execute install Class::Singleton
Whichever solution you use, make sure to run install DateTime and install DateTime::TimeZone to ensure that both of these modules are now installed properly.


  1. Excellent article! Liked the Disney world analogy.

  2. it doesn't work on my macbook pro with snow leopard.

    i've got this error during the first installation of per module using CPAN: install GD.

    Warning (usually harmless): 'YAML' not installed, will not store persistent state Going to build L/LD/LDS/GD-2.45.tar.gz

    Notice: Type perl Makefile.PL -h for command-line option summary.

    Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher.
    If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd.
    Warning: No success on command[/usr/bin/perl Makefile.PL]
    Warning (usually harmless): 'YAML' not installed, will not store persistent state
    /usr/bin/perl Makefile.PL -- NOT OK
    Running make test
    Make had some problems, won't test
    Running make install
    Make had some problems, won't install
    Could not read '/Users/nouvsophat/.cpan/build/GD-2.45-jHGpmV/META.yml'. Falling back to other methods to determine prerequisites
    Failed during this command:
    LDS/GD-2.45.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL' returned status 512

  3. Please help me with my above problem.

  4. I don't remember GD being required for installation. Was that listed in the section titled, "COMMANDS TO INSTALL REQUIRED MODULES?"

  5. yes, it's part of perl module requirement for bugzilla latest version.

    Now I've found the solution. I do it the manual way. Download each module separately and install it one by one. But it's very time consuming. Hope I can go through the CPAN method.

  6. After major problems getting DBD::MYSQL to finally install(reverting back to bugzilla 3.6.4 did the trick) and thinking everything was working great, I find that it's not working after all. Even though all tests from pass with flying colors I'm getting errors trying to load the index page. Specifically, the error message is:

    Software error:

    install_driver(mysql) failed: Can't load '/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib
    Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
    Reason: image not found at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/ line 230.
    at (eval 42) line 3
    Compilation failed in require at (eval 42) line 3.
    Perhaps a required shared library or dll isn't installed where expected
    at Bugzilla/ line 1101

    I'm so close but every time I think I finally have this working, another problem comes up. I'm on Mac OS X server version 10.5.8. I do wonder if there is a problem with Apache2 running in 64bit mode vs. 32bit Perl and MySQL. If anyone has any ideas I would love to finally be done with this install. Thanks

  7. I found the solution to my problem. I'm posting here in the hopes that I can save someone hours of frustration. If you see this in your logs-

    config.cgi: install_driver(mysql) failed: Can't load '/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bun
    dle' for module DBD::mysql: dlopen(/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib
    [Sun Mar 27 00:44:00 2011] [error] [client] [Sun Mar 27 00:44:00 2011] config.cgi: Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
    [Sun Mar 27 00:44:00 2011] [error] [client] [Sun Mar 27 00:44:00 2011] config.cgi: Reason: image not found at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/ line 230.
    [Sun Mar 27 00:44:00 2011] [error] [client] [Sun Mar 27 00:44:00 2011] config.cgi: at (eval 42) line 3
    [Sun Mar 27 00:44:00 2011] [error] [client] [Sun Mar 27 00:44:00 2011] config.cgi: Compilation failed in require at (eval 42) line 3.
    [Sun Mar 27 00:44:00 2011] [error] [client] [Sun Mar 27 00:44:00 2011] config.cgi: Perhaps a required shared library or dll isn't installed where expected
    [Sun Mar 27 00:44:00 2011] [error] [client] [Sun Mar 27 00:44:00 2011] config.cgi: at Bugzilla/ line 1101

    Run ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib

    There's probably a better way to handle this but it got my bugzilla up and running.

  8. @Anonymous: I'm heading out right now but, quickly looking over your error message, it seems you're missing certain modules, for some reason.

    Look everywhere that says something like:


    and try running a related install command of the form:

    install Blah::foo

    From the looks of things, it seems your errors are related to MySQL and the file. If I get some time tomorrow, I'll try to look into this further. Since our server is working, I'll also check whether it runs in 64 bit (I think it might be)...

  9. Great post, I have gone through all the steps (apparently) successfully, except I can't actually open bugzilla. I'm not sure I have the correct domain name. My computer is defined in the form
    When I enter that, I get a screen that says "It works!". When I enter it says "internal server error". Am I using the wrong domain name? Thanks in advance for your help!