IT Werkz Sometimes

Finding bugs in digital stuff, easy




Archive for the 'Drupal – is this all it’s cracked up to be?' Category

Setting up Drupal on a hosted server, oh no you don’t

Posted by testcrunch on 13th April 2010

I fancied a new project so I’ve been reading a book on Drupal, or to put it another way, immerse myself in some kinda hell to see if I can then sort it all out.

I’ve started to play around with the software and as usual it takes ages to get any kind of process going, as I bounce from one problem to the next. There’s the Drupal package to be downloaded and installed and that is written in PHP so I need to get that installed again. Then there’s the MySQL database that I’ll need. This sounds familiar from sometime last year when I poked around with this stuff, but precious little is still installed. The book said to create a MySQL database and then update some Drupal site settings to point to that database. OK, I created a MySQL DB on the server with PHPMysqlAdmin, but then it said to browse for and import a DB structure from one of the Drupal folders.

Problem number one, Drupal wasn’t yet installed. I downloaded that and unzipped it but there was no database in any of the Drupal folders to use. OK again, I exported the MySQL database from this blog, and which obviously has tables, to my local drive and browsed and imported that. The slider bar implied that it was doing something but at the end of the import process the new DB still had no tables and was stuck at 0mb. Heaven knows what the import process was doing, but it wasn’t much. Before the import I had amended the settings.php file to point at the new DB so I changed that to point at this blogs database. I then uploaded the whole Drupal folder, and not just the files within the folder which otherwise would probably have overwritten some of this blogs files. I then ran the install.php file from the Drupal folder on the server which did load correctly into a browser and I did get a couple of errors where I had amended the default site settings and got the database name wrong, but at least the install.php file started to load. This proved that I had access to the servers PHP.

The last error message was that I needed to turn off Register Globals in the php.ini file. Oh yeah, how the heck do I do that? PHP is part of the service that the server provides, and which has Register Globals set to On. Obviously I can’t change that setting but the hosting company do apparently support Drupal so maybe some more investigation is needed.

So it’s back to running it locally. The exported DB from this blog exists on my hard drive so all I need to do is get a local copy of MySQL installed, create a DB and import the exported blog DB into that DB with PHPMysqlAdmin. Then when that DB has tables and some data then I can set the Drupal settings.ini file to point to the local DB and fire up the install.php file that resides in Drupals folders somewhere. Before I do that I’ll set the php.ini files Register Globals setting to On, which should stop the install.php file dead in its tracks, but at least I’ll feel in control of whats going on.

When I get the message about Register Globals I’ll amend the php.ini file to what it wants and hit retry and that will hopefully install the Drupal framework and I can get on and play. And what have I forgotten? Jeez I need to get my PC to run as a web server so need to install IIS or Apache.

So, an overview of what I have done.

Hosted version
1. When I tried with the hosted server I was able to create a new DB with PHPMysqlAdmin but when importing a large SQL file into it, the process did seem to thrash about, but nothing was actually loaded. Also the DB that was supposed to exist within the Drupal folders wasn’t there.
2. I was able to FTP the whole Drupal folder onto the hosted server.
3. Running Drupals install.php file was OK in that it did start from a browser but there were issues with the settings.ini parameters. These I was able to fix.
4. As Drupal is written in PHP the running of the install.php file also proved that I can run PHP files on the hosted server
5. The Register Globals parameter setting of On finally stopped the installation of Drupal onto the hosted server.

Local version
1. I’m still in the midst of setting this up but I do have this blogs DB exported as an SQL file.
2. I need to install MySQL locally, create a DB and then import the SQL file into it.
3. I need to amend Drupal’s seettings.ini file to point at the newly created DB.
4. I need to have PHP installed and the php.ini amended to set Register Globals Off.
5. I need to setup my local PC as a web server so IIS or Apache will need to be installed and run asa a service.
6. If 4 is done then simply running Drupal’s install.php file should install the Drupal framework ready for use.
7. Heaven knows what Drupal does with the pretty full DB created in 2.

Posted in Drupal - is this all it's cracked up to be? | No Comments »