Installation issue on Ubuntu 10.04

TomSwirly / 2011-08-01 18:15:23   

Hello, Indies. I successfully installed indexhibit on a previous server but this time I'm getting an error I can't debug...

I'm using a very generic Linux server, Ubuntu 10.04 "Lucid Lynx", on a clean Rackspace cloud server. I'm pretty sure I created the database user and table with the correct permissions and name.

I visit http://www.tomswirly.com/ndxz-studio/install.php, select English, I see OK for all the entries and get to the database setup page, where I enter the correct information.

However, pressing Submit on this page gives me a server error 500. Looking in my server log I see the following error:

[Mon Aug 01 23:08:53 2011] [warn] [client 24.42.78.130] mod_fcgid: stderr: PHP Notice: Trying to get property of non-object in /home/tomswirly/public_html/ndxz-studio/helper/html.php on line 18, referer: http://www.tomswirly.com/ndxz-studio/install.php

Let me reassure you that, unlike many other people asking questions here, I am not running Windows. :-)

You can see my PHP configuration here: http://www.tomswirly.com/info.php

I'm perfectly able to edit the PHP code to add debug statements (and probably will sooner or later if I can't figure out it any other way).

Thanks in advance!

Vaska A / 2011-08-01 18:26:34   

I was able to get beyond where you got no problem. Perhaps it was a server hiccup or your domain is so new you get the occasional, random 500 error.

Also, it's possible that the files were not fully uploaded (with FTP, it does happen). Simply try reuploading.

It's Rackspace...it's going to work. ;)

TomSwirly / 2011-08-01 18:51:26   

Thanks for the ultra-fast response!

It's not possible that files are missing - I ftped the .zip file as a whole.

And I still get the server error each and every time, with the same message in the server log.

I'm using

Exhibition name: TomSwirly
Database server: localhost
Database Name: tomswirly
Database Username: tomswirly
Database Password: TestTestTest

(I just changed the password to that and will turn it off later.)

It's conceivable that your DNS record is pointing you to the old server (though I just checked it's fine wherever I can check it), so I actually removed the files on the old server so you can't conceivably hit them.

Vaska A / 2011-08-01 18:55:44   

The error message above does indicate that there could be something wrong with files. Reupload /ndxz-studio/helper folder. But, it could be other files...ftp fails more often than you know.

Is the above info correct? I can't imagine that Rackspace still uses 'localhost'.

TomSwirly / 2011-08-01 19:05:18   

Let me give it a try!

But if ftp failed, then the whole .zip file would be corrupt, yes?

TomSwirly / 2011-08-01 19:05:40   

Actually, I used scp, not ftp!

TomSwirly / 2011-08-01 19:12:05   

OK, I did the whole thing from scratch and the same error!

I did remember to chmod 777 config/ and files and files/gimgs...

Vaska A / 2011-08-01 19:22:37   

But if ftp failed, then the whole .zip file would be corrupt, yes?

No. File uploads often fail - I don't need to say this again.

Something seems wrong but I don't really know. My guess is that there is a bad file or the database has user has the wrong privileges or something is simply not right with the database. Try a different database and make sure the connection info is correct.

TomSwirly / 2011-08-02 00:10:28   

> No. File uploads often fail - I don't need to say this again.

As I noted, I did do the upload again before I reported back.

scp uses ssh to guarantee authenticity of the copy so I'd be quite surprised if scp silently corrupted a file and I'd be doubly surprised if it managed to silently corrupt a zip file in such a way that it was still openable. I searched, but wasn't able to find anyone else claiming to experience this corruption - I rely on scp for mission-critical applications, which is why I'm following that up, I don't like to feel insecure about critical things.

ftp is insecure and unreliable - it sends the password in cleartext, even! Never use it.

> Try a different database and make sure the connection info is correct.

I did recheck the database information, the perms, and will try tomorrow to create a new database.

I did, however, get to try changing the database information on the original server I was running on ("deliberately breaking the original"), and in that case I get a message saying that the database is not set up - but that was just a quick, hacky test. I still feel from reading the code that I should get a clear error if I didn't set up the database credentials right, not this 500 error.

I'll follow this up tomorrow and report back with a solution (I hope). It's all in PHP so I should be able to debug it with, shudder, print statements...

TomSwirly / 2011-08-02 15:31:37   

All right, I have a good solution - let me also "show my work". :-D
.

COLLECTED DATA

I tried a different database (and user) with the same results. I was however able to connect with the mySQL database from the command line:

$ mysql -u tomswirly -pTestTestTest -h localhost tomswirly
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 977
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

and I could create and delete tables, so it didn't seem to be that this account doesn't exist or doesn't have perms

By putting print statements into the code, I can see that everything's fine until the call to mysql_connect near line 326 - but the code never gets past that.

I tried changing php.ini to set

mysql.connect_timeout = 1

but no change in behaviour (and I made sure I was in fact changing the right php.ini file by changing display_errors = On at the same time).

Finally, the errors from the logfile seem to have nothing to do with it - it seems to me that they'll always happen during installation, when you call ips() and get_instance() has yet to be initialized.

.

UNDERLYING PROBLEM:

It turns out that the basic PHP installation on this version of Ubuntu does NOT have mySQL installed.

I could have immediately deduced that from this page: http://tomswirly.com/info.php had I known what to look for! (I was fooled because it did mention SQL a few times but this turned out to be in other packages...) I've done very little PHP before so I'll know to look for this in future.

Unfortunately, there seems to be no way in the code to get PHP to report an error instead of hanging in this case.

.

SOLUTION:

To fix this, from the command line type:

$ sudo apt-get install php5-mysql

.

Thanks for your help and hope that this is helpful in getting the next person who might encounter this issue!

guitaryf / 2011-08-10 00:17:36   

Edited by Vaska: spam

This thread has been closed, thank you.