Installing Drupal 6.1 at StartLogic: Troubleshooting Case Study

decibel.places - March 17, 2008 - 04:34

I am a new subscriber to Start Logic, and while I have installed Drupal a few times previously, I ran into some unexpected problems.

There may be some useful info here about troubleshooting installations, and possibly suggested inclusions into future installation scripts.

Problems first appeared after I set up the database in phpMyAdmin, and tried to run the installation script in the browser (Firefox Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12) - although none of the problems were browser related.

I received a "500 Internal Server Error"
Solution: I had to turn on "CGI Scripting" in the site control panel (Vdeck 3.0) - counter-intuitive, but my live support agent confirmed: "Seward Robinson: Yes, you have to enable CGI to run PHP on our server."
Then, I received a warning about the PHP environment: "register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled."
I checked the .htaccess file, globals were Off. They were also Off in the php.ini file.
The problem was that auto_globals_jit were On in the php.ini file - so when I set auto_globals_jit to Off, the warning went away
Setting up the database, I couldn't connect. I checked the database name, the username, the password...
I barely noticed the "advanced" link, but when I clicked it, I discovered the script was trying to connect to "localhost" - I had to set it to "USERNAME.startlogicmysql.com" (I think that is probably more secure than the more standard "localhost") - even though I had entered
"$db_url = 'mysql://USERNAME:PASSWORD@USERNAME.startlogicmysql.com/DATABASENAME';" in default.settings.php

It would be more elegant if the script picked up the mysql url from default.settings.php instead of using the default "localhost" at that point, hidden as it is under the "advanced" settings....

So far, I am pretty happy with StartLogic, their Live Support was friendly. here's a transcript of the sessions, FYI:

Seward Robinson: Hi Randall. I apologize for the wait time. My name is Seward Robinson, how are you today?
Randall: hello
Randall: happy Palm Sunday
Seward Robinson: How can I help you today?
Randall: I am installing Drupal 6.1, getting 500 Internal Server Error when running install script
Randall: I've installed Drupal on other servers, never had a problem
Randall: Drupal files are in directory "drupal61" just under public_html
Randall: http://USERNAME.startlogic.com/drupal61/ or http://netsperience.org/drupal61/ - neither works
Randall: tried removing .htaccess file, but still had error
Randall: is mysql login "localhost" eg: $db_url = 'mysql://USERNAME:PASSWORD@USERNAME.startlogicmysql.com/DATABASENAME'; ?
Seward Robinson: Could you please hold for 2 to 3 minutes, while I review your account?
Randall: can I use my main username for the site also as a username for the mysql db?
Randall: ok, go ahead
Randall: I also tried connecting to db with localhost: $db_url = 'mysql://USERNAME:PASSWORD@localhost/DATABASENAME';
Seward Robinson: To protect your account from unauthorized changes, can you please verify for me the answer to the Security Question:
Seward Robinson: What is your mother's maiden name?
Randall: MAIDEN NAME
Seward Robinson: Thank you for the authentication.
Seward Robinson: I have noticed that ‘CGI and Scripted Language Support’ for your account is not enabled. Hence, you have experienced the issue.
Seward Robinson: To enable the ‘CGI and Scripted Language Support’, please go to the link at:
Seward Robinson: CGIADMIN
Seward Robinson: Once you enabled the ‘CGI and Scripted Language Support’, your PHP scripts will be functional with in 15 minutes.
Seward Robinson: Your account MySQL host address is USERNAME.startlogicmysql.com and not localhost.
Randall: drupal doesn't use CGI - it's PHP/MySQL
Randall: I enabled the scripting on the link you sent
Seward Robinson: Yes, you have to enable CGI to run PHP on our server.
Seward Robinson: Okay.
Seward Robinson: You can try by creating the MySQL username same as your account username. If it not allow you to create the MySQL username same as account username then you have to try using other username.
Randall: now it's working fine, thank you
Seward Robinson: You're welcome!
Seward Robinson: Okay.
Seward Robinson: I only have your first name. Can I have your complete name for our records?
Randall: Randall Goya
Seward Robinson: Okay.
Seward Robinson: Could you please let us know if you have contacted us earlier via e-mail with regards to the same issue?
Randall: I opened a ticket about trouble with ftp, but that is ok now and I tried to close it
Seward Robinson: Okay.
Seward Robinson: Can you please let me know whether I have missed to answer any of your questions?
Randall: everything is fine, thx for your help
Seward Robinson: Okay.
Seward Robinson: You're welcome!
Seward Robinson: Is there anything else I can assist you with today?
Randall: have a nice day, goodbye
Seward Robinson: Thank you for chatting with us. Please feel free to contact us at any time. We are available 24x7.
Chat InformationChat session has been terminated by the site operator.

Seward Robinson: Hi Randall. I apologize for the wait time. My name is Seward Robinson, how are you today?
Randall Goya: Hello and happy Palm Sunday. I am installing Drupal 6.1 - I get this warning about the PHP environment: register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled. The PHP manual has instructions for how to change configuration settings. (Currently using PHP register globals Enabled ('1')) The .htaccess file for the directory I installed drupal ("drupal61") has the code to turn globals off: # PHP 5, Apache 1 and 2. php_value magic_quotes_gpc 0 php_value register_globals 0 php_value session.auto_start 0 php_value mbstring.http_input pass php_value mbstring.http_output pass php_value mbstring.encoding_translation 0 (I think you have PHP 5, but there is also code for PHP 4, Apache 1 & 2
Randall Goya: you were very helpful earlier advising me to enable the scripting... but I let you go too soon
Seward Robinson: Okay.
Seward Robinson: Could you please hold for 2 to 3 minutes, while I review your account?
Randall Goya: sure
Seward Robinson: To protect your account from unauthorized changes, can you please verify for me the answer to the Security Question:
Seward Robinson: What is your mother's maiden name?
Randall Goya: MAIDEN NAME
Seward Robinson: Thank you for the authentication.
Seward Robinson: You can edit the php.ini file of your account by going to the link at:
Seward Robinson: PHPADMIN
Randall Goya: ok
Seward Robinson: Here you can be able to enable and disable any of the settings that needs to be done for your account.
Seward Robinson: Is there anything else I can assist you with today?
Randall Goya: I looked at php.ini for PHP 5 and register globals is off: register_globals = Off (line 389)
Seward Robinson: Okay.
Randall Goya: but when I went first, the php version was set to 4, not 5
Seward Robinson: Perilously, the PHP version for your account is set to 4. This is the reason your are experienced the issue.
Randall Goya: I set the php version to 5 at PHPADMIN but I am still getting the same warning that globals are on
Randall Goya: In line 406 of php.ini for PHP 5, auto_globals_jit = On - should I change it to Off?
Seward Robinson: It's depending on the application that you install.
Seward Robinson: We can't suggest, which should be on or off.
Randall Goya: I am trying to set register_globals to Off instead of On
Seward Robinson: You have to update as you receive the message while installing the application.
Randall Goya: I did a hard reload
Seward Robinson: Okay.
Randall Goya: should I put .htaccess file in root instead of subdirectory?
Seward Robinson: Can you please elaborate your last statement?
Randall Goya: Drupal has .htaccess file with statements to turn off PHP globals - I put it in the root of the Drupal installation, in subdirectory "drupal61" - should it be in web root "public_html"?
Randall Goya: What about "auto_globals_jit" in php.ini - should I change it from On to Off?
Randall Goya: ok - I set auto_globals_jit to off, now it's ok - please stay on a couple of minutes so I see if there's more problems
Seward Robinson: Please note that the root folder on our platform is 'public_html'. You have to contact the vendor of the application to know more on install the that application in your account.
Seward Robinson: It's depending on the application that you install.
Seward Robinson:
Seward Robinson: Unfortunately, we can't suggest, which should be on or off.
Seward Robinson: Okay sure.
Randall Goya: now I have another database problem
Randall Goya: I'm getting an error
Randall Goya: Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).
Randall Goya: I am using correct databasename, username and password
Seward Robinson: Okay.
Seward Robinson: Can you please provide me the database host address that you are using?
Randall Goya: USERNAME.startlogicmysql.com/DATABASENAME
Randall Goya: does the database have any kind of prefix?
Seward Robinson: No.
Seward Robinson: You have to use USERNAME.startlogicmysql.com database host name and not USERNAME.startlogicmysql.com/DATABASENAME.
Seward Robinson: Is there anything else I can assist you with today?
Randall Goya: no, it's not working, I tried it without the database name USERNAME.startlogicmysql.com but the application is asking for the databasename which is "DATABASENAME" -- is it a problem if the db username is the same as the main username for my site?
Seward Robinson: No.
Seward Robinson: Can you please provide step by step instructions to duplicate your issue?
Randall Goya: is this the correct socket? Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).
Seward Robinson: Can you please provide step by step instructions to duplicate your issue?
Randall Goya: ok
Randall Goya: this is the login that is entered in the script -> $db_url = 'mysql://USERNAME:PASSWORD@USERNAME.startlogicmysql.com/DATABASENAME';
Randall Goya: I created the database "DATABASENAME" in phpMyAdmin with username USERNAME and password PASSWORD
Randall Goya: In the application, I am entering databasename "DATABASENAME" username "USERNAME" and password "PASSWORD"
Randall Goya: I get an error:
Randall Goya: Database configuration The following error must be resolved before you can continue the installation process: Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).
Seward Robinson: Can you please provide me the exact URL where you are getting the error?
Randall Goya: http://USERNAME.startlogic.com/drupal61/install.php?profile=default&loca...
Seward Robinson: Can you please provide me the database name, username and password to replicate your issue and install the application?
Randall Goya: I created the database "DATABASENAME" in phpMyAdmin with username "USERNAME" and password "PASSWORD"
Randall Goya: ok, i fixed it
Randall Goya: I had to change database host on advanced options from "localhost" default to "USERNAME.startlogicmysql.com"
Randall Goya: please stay with me a couple more minutes
Seward Robinson: Okay.
Randall Goya: it looks ok now, the installation is complete, thanks for your help -- you should note some the problems and solutions for other clients who are installing Drupal
Seward Robinson: You're welcome!
Seward Robinson: Okay.
Seward Robinson: Could you please let us know if you have contacted us earlier via e-mail with regards to the same issue?
Randall Goya: no, just one previous chat today, with you
Seward Robinson: Okay.
Seward Robinson: Is there anything else I can assist you with today?
Randall Goya: no, thank you, goodbye
Seward Robinson: Thank you for chatting with us. Please feel free to contact us at any time. We are available 24x7.

I'm not sure it was the same person both times, the first one seemed a little more on the ball...

Ok, now back to building netsperience 2.0 - upgrading from a 10-years-in-development GeoCities Free site, no PHP/MySQL, just a lot of JavaScript in netsperience 1.0

Hope this helps someone

changing localhost default to "username.ipowermysql.com" worked

eva - March 21, 2008 - 12:55

i got error of "/var/run/mysqld/mysqld.sock' (2)" and was unable to connect to db during setup.
i followed suggestion in above comment to change hostname under "advanced options" to "username.ipowermysql.com"and it worked (got address from online help). hallelujah. i've made it past the initial gauntlett!

thanks, netsperience.
eva

my sites: http://www.evarubin.com

Thanks

stino - March 21, 2008 - 22:58

This also worked for me, example.startlogicmysql.com, in advanced settings.

Database tables

mvalentiner - December 18, 2008 - 03:38

These instructions have been very helpful, but I'm missing one step. How do I "set up the database in phpMyAdmin" with StartLogic? I created the db with StartLogic > MySQL Management > Add New Database, but the db has no tables. How do I initialize the db so it has the tables Drupal needs? Any help is greatly appreciated.

populating database tables

decibel.places - December 18, 2008 - 18:29

There are detailed installation guides: http://drupal.org/getting-started/6/install

I will summarize here for your specific question about database tables.

It depends on whether you are creating a new Drupal site or moving an existing site over to a new server.

If you are creating a new site, you can simply upload the most recent Drupal core files to your server and point the browser to the directory (by setting a domain pointer, a subdomain pointer, or just a subfolder, eg "http://mydomain/drupalfoldername/"

You may be required to copy the sites/default/default.settings.php file to a new file named settings.php - enter your database name and username and password and the path to your database server (typically "localhost" but on StartLogic it is "USERNAME.startlogicmysql.com") - and be sure to set the permissions on settings.php to make it writeable (chmod 777).

assuming all is set up correctly (refer to the installation guide http://drupal.org/getting-started/6/install ) Drupal will run through the install script and create the tables in the database for you.

========================================

If you are moving a site, you need to

1. Copy all the code (particularly the sites/ folder with your contrib modules and themes)
2. Export your entire database (you can do this with phpmyadmin, or the excellent Drupal backup and migrate module).

Place your code in the desired directory as above... make sure your sites/all/settings.php is updated with the current database name, username, password, and SQL server info!

Import your database -

A. You could do it with phpmyadmin - most likely you need to create a database first - as you have already done

B. You could alternatively create a default install of a new Drupal site, install and enable the backup and migrate module, and use the backup from the previous site to import the db tables

~are you netsperienced? /\_][_][_/\ Reliable Web Hosting - cheap!

Where is the "advanced" link?

mvalentiner - December 19, 2008 - 00:11

Thank you for your prompt reply!

My confusion about running the script to populate the Drupal db came because when I can access the site, I am getting a bunch of errors that various tables don't exist . I thought the install script wasn't running. But, perhaps I'm not connecting to the db.

Looking back at your case study, the only thing I don't follow is the "advanced" link. Where is that ("MySQL Management", MyPHPAdmin, somewhere else?) and what is the script trying to connect to the db? In settings.php, I've set
$db_url = 'mysql://MySQLUserName:PASSWORD@ SLUSERNAME.startlogicmysql.com/DATABASENAME

Mike

Got it working!

mvalentiner - December 19, 2008 - 21:27

I got it working! For some reason, when initially trying to access the site, I was getting mysql errors (hence, no install page, and no "advanced" button. Thanks again!

 
 

Drupal is a registered trademark of Dries Buytaert.