Bluehost hosting and issues with pdo_mysql, .htaccess, and php.ini

Thought I'd share this in case anyone is using Bluehost and trying to get Omeka up and running.

I had lots of difficulties, and it took a few rounds with tech. support to find someone who could nail down the issue. Once found, it seemed to be all good. Here's a run-down.

1. Though they're on PHP 5.2, their configuration doesn't have pdo_mysql active. That needs to be done in the php.ini file in all directories. Start with the php.ini file they provide in the root directory and add this under the list of extensions.

Make sure you copy the php.ini file into all the subdirectories

2. I'm fuzzier about this one--maybe someone in the forum with deeper knowledge of Apache can help me out. They said that the php_value command in the .htacces file needs to be moved into the php.ini file. Their tech. support did this for me and all is good, but I didn't think ahead enough to ask them for a line # to see what exactly they did--bad and silly me.

Without those, I was getting errors that php_value was not defined, couldn't be found, or couldn't be initialized. I would also get this Apache error: [an error occurred while processing this directive].

Upshot: if you're using bluehost, these are some things to watch for. And, don't let their tech. support go in circles by telling you repeatedly to make sure php.ini is copied into all the directories. Ask about the php_value command in .htaccess that needs to be moved to php.ini.

Good luck!

Hi, Patrick. Good to hear that you got Omeka to work in Bluehost. I had tried to work with them to see what was wrong, but I got brushed off by their support staff. I'm curious as to which version of Omeka you were running when you encountered these problems. We still have problems getting Omeka to work on Bluehost, but in the latest release of Omeka we have fixed one of the problems you reported.

Namely, Omeka no longer requires pdo_mysql to connect to the database. Instead it uses the mysqli extension, which is installed by default with PHP 5.2.x.

When you say that Omeka works on Bluehost, do you mean that everything works properly? I have been able to get it to install correctly, and the home page loads properly, but none of the links work, nor does the administrative interface. I had thought it was related to the .htaccess directives somehow. Moving the php_value directives out from the .htaccess to the php.ini file does not seem to fix that part, but maybe it has something to do with having the php.ini file in every directory.

With regards to putting the php.ini file in subdirectories, do they mean to say that it should be in *all* subdirectories of the application? Many web applications have a complicated directory structure, and copying the file manually would probably take a long time. Is this something that Bluehost will do for users if you ask them?

If you get a chance, could you let me know whether your Omeka install is fully working, and what version you had installed? Thanks.

I installed the site on lunarpages and am having the same problem. The install site worked,but I can not get into the administrative part.

As Kris indicated in his comment above, did you sure you copy the htaccess file that's included in the /admin/ directory? Failure to do so will result in an error message.

I checked and I have the file.

This is the line from my errorlog

[Sat Feb 23 10:50:56 2008] [alert] [client] /home/south150/public_html/colquitt/colquitt/admin/.htaccess: Invalid command 'php_value', perhaps mis-spelled or defined by a module not included in the server configuration

This is from the htaccess file

<IfModule mod_php5.c>
php_value display_errors 1
php_flag zlib.output_compression On
php_flag register_globals off
php_value zlib.output_compression_level 5

Hey gspurloc, in the future it's best to open separate threads for these problems.

I just tried setting up Omeka 0.9.0 on a LunarPages account we have to test Omeka and it's compatible with LunarPages. There are a few ideas that come to mind of why this isn't working:

You said you've uploaded the htaccess file - have you also included the one in Omeka's base directory? There's one there in addition to /admin/

Going over the easiest ways for Omeka not to work, I wonder if you have PHP5 turned on. In cPanel, LunarPages offers the easy option to turn this on and off - when I tried turning it off with my test account all heck broke loose. With that said, I received a parse error and not what you're seeing. If it's none of these then we'll have to brainstorm further.

Maybe Kris has some thoughts/ideas?

Sorry I haven't had a chance to get back here....

Bluehost does say that php.ini should be copied to all directories. They have a script that they will give you to automatically copy it to all subdirectories, so that speeds things up nicely.

The current ones going are the beta (0.9.0). All I can say is that so far everything is working okay. I don't think that items are going into it yet (there are four installations of it for use by students in a digital history class taught by Jeff McClurken).

But here's something I forgot in my first post (sorry). Many of the file permissions had to be changed to 755 before everything was going okay.

Once I got an installation working, I immediately zipped it all up so that I'd have a copy of what was working. Is there I way I should try to pass that on to you?

Patrick -- Sure, I'll take a look at it to see what they did. If you zip it up and send it as an email attachment to that'd be great. Also - could you send along the script that Bluehost gave you to copy the php.ini file to all subdirectories? I'd be interested in looking at it, and eventually adding this information all to the codex for future users.

I attempted a clean install of Omeka this morning on Bluehost and everything is up and running without problem. I tried, unsuccessfully, a couple months ago to install on Bluehost and encountered the same problems as described in previous postings. Not sure if this release resolved the issues or if Bluehost made server adjustments. Either way the install went smoothly and without error.

Chris G.
Glad to hear all is working well with the newest version.

So I think I've installed things correctly, on Bluehost, but when I hit the install link I"m getting this:

MySQL connection error: [1045]

Access denied for user MYUSERNAME@'' (using password: YES)

Please refer to Omeka documentation for help.

Am I missing something simple?

That error means that you need to enter the correct MySQL login credentials into your db.ini file. An access denied error only happens when the username/password/host doesn't authenticate properly.

The script you need to propagate php.ini through Bluehost (and probably a zillion other ISPs) is this:

'<?php system("find * -type d|xargs -i cp --verbose php.ini {}/."); ?>'

(Not certain if I actually have the correct 'backtick' character. Copy and paste from the left '<' to the right '>' and you'll be fine. The allowed markup of should have it covered, so I am confused about the need to use the backticks at all. Perhaps this page is interpreted and this is a safety check to make certain that 'live code' doesn't run accidentally?)

Place it on a text page all by itself and give it a name that ends in "php", such as "somename.php". Give it, and php.ini file attributes of 755 on a Unix-based server.

Then, surf to that page with your browser.

Your screen should fill up with all the zillions of places the php.ini file has been copied to.

You should be able to drop to 700 for "somename.php" after execution, but php.ini needs to remain executable.

I ran into the identical problem while installing "Magento" (e-commerce software rumored to be quite good). I traded the pdo_mysql error message for a blank screen. Ah well, onward and upward!

My copy of .htaccess does not have a line about php_value in it at all. So I would ask the original poster to download a copy of the php.ini file and the .htaccess file he is using and, using a text editor, perform a search for the php_value string. It would bring him great glory and honor and international acclaim if he would close the loop he has opened by reporting the full resolution.