cancel
Showing results for 
Search instead for 
Did you mean: 

MySQL and PHP Question

N/A

MySQL and PHP Question

Hello All.
I work for a small not-for-profit company (also a F9 customer) that helps companies understand how a wide range of technologies will develop, and how they can use those technologies for their commercial benefit. Essentially, this means that we produce a lot of documents, but we've always published our work on our website manually and this laborious publication process consumers ever-more of our (very limited) resources.

So, in my own time, I've decided to try and get us using an open source PHP- and MySQL-based content management system called ezPublish. Unfortunately, I'm having real difficulty in getting it to work, and would appreciate any advice that you could offer.


I've managed to install the PHP software in accordance with the installation instructions, but can't get the PHP stuff to talk to MySQL. It down to some settings that I need to get right in a file called site.ini but no matter what I try I always get the same error message! Here's the error:
------------
[tranceplant@crofters ezPublish]$ mysqladmin create tranceplant_f9
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (11
1)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
--------------

After search of Google suggested that check to see if MySQL was running by using the "ps" command, but all I got was permission denied.

Another source that I found on Google suggested that I try and specify an IP address for the "MySQLserver=" parameter in site.ini (the PHP file that tells the PHP program where to look for the database) but I couldn't that IP address anywhere. Also, I assume in the field for "Server=" I should be using "rumpus" rather than the default "localhost"?!

Any help would be gratefully received! I'm searched all around the net and am completely stuck!

Thanks,

Dave
9 REPLIES
Sword
Grafter
Posts: 41
Registered: 10-10-2007

RE: MySQL and PHP Question

I'm experimenting with a postnuke CMS at the moment and would recommend it; setup was pretty straightforward.
Don't know if this is of help, but here's the setup setting in the config file of postnuke:

// dbtype: type of database, currently only mysql
// dbhost: MySQL Database Hostname
// dbuname: MySQL Username
// dbpass: MySQL Password
// dbname: MySQL Database Name
// system: 0 for Unix/Linux, 1 for Windows
// encoded: 0 for MySQL information unenccoded
// 1 for encoded
// ----------------------------------------------------------------------
//
$pnconfig['dbtype'] = 'mysql';
$pnconfig['dbhost'] = 'rumpus';
$pnconfig['dbuname'] = 'username';
$pnconfig['dbpass'] = 'e-mailed to you';
$pnconfig['dbname'] = 'username_f9';
$pnconfig['system'] = '0';
$pnconfig['prefix'] = 'nuke';
$pnconfig['encoded'] = '1';

As I said, hope this helps!
Regards,
Sword
N/A

RE: MySQL and PHP Question

Thanks, Sword.

Still can't get it working. Same problem about not knowing the MySQL socket to connect to. It's a shame: ezPublish seems to fit our needs perfectly.

I had a look at postnuke and, unfortunately, it's too community-orientated for our needs; we don't need any community features, just publishing. I'm now looking at Plone, which is built on Zope. You never know, I might even have a go with Zope itself.

Thanks again for your suggestions.

Dave
N/A

RE: MySQL and PHP Question

Hi Dave, Not sure if this will help you - have you tried to ping crofters? If you do in the results it will supply you with the IP address of the server, if you use this you may find you can connect...
This may be no help I am not sure, I am assuming that you are trying to connect to your F9 MySql D/B by using the publishing software? As for the .ini file these will be in the /bin folder and will need to contain the Username and Password of your account..
Sword
Grafter
Posts: 41
Registered: 10-10-2007

RE: MySQL and PHP Question

Dave, how far have you got in installing this?
Have you managed to use the sql file to create the (numerous!) tables?
I've got up a login page, with many errors, but I couldn't do a full install and keep within 25 MB!
I'd be interested to know how far you're on in the installation process.
E-mail me if you wish.
Sword

N/A

RE: MySQL and PHP Question

> have you tried to ping crofters?

Good thinking, Richard: I hadn't thought of doing that. But unfortunately I still get the same error message. Maybe I need to use a particular port number? The other thing that's occured to me is that maybe crofters just doesn't understand the "mysqladmin" command that the installation guide tells me to use. I've tried using different mysqladmin commands such as "mysqladmin ping" but that doesn't work either.

> I am assuming that you are trying to connect to your F9 MySql D/B by using the publishing software?

Correct.

> As for the .ini file these will be in the /bin folder and will need to contain the Username and Password of your account..

I don't know what you mean by /bin, but I found and edited the site.ini file as per the installation guide (that's also the file that I entered the IP address for the "MySQLSocket" parameter.

Thanks so much for your suggestions anyway! I'll continue to post back here with any developments. And, of course, if anything else strikes you as a possible solution then don't hesitate to let me know! Smiley

Dave
N/A

RE: MySQL and PHP Question

> Dave, how far have you got in installing this?
[...]
> I couldn't do a full install and keep within 25 MB!

When I first downloaded it, I decompressed it on my desktop machine and something wierd happened: Although Windows Explorer reported that it had a total file size of ~9MB, it took up ~45MB on the disk. So I had a look through the installation guide and saw a way of getting the server to decompress it. So I uploaded the single ~2MB file to crofters, decompressed there, and did the CHMOD-ing. A file size check indicated that it taking up about 10MB as it should be! Smiley

> Have you managed to use the sql file to create the (numerous!) tables?

No, I've not got that far: I can't even connect to the database so I figure that there's no chance of getting the database to read the file that will create all of the tables.

> I've got up a login page, with many errors

I also managed to dispay a login page, but don't remember any error on it. Did you remember to copy and rename one of the files in the installation directory (I'm at work now and can't remember which one) to .htaccess and move it to the top of your installation directory? I don't know if that's got anything to do with it...?

Have you had the same MySQL socket problems as me?

I'm not a software guy so all of this is pure guesswork for me! It's a shame that the documentation isn't a bit clearer, but as it's free I guess we can't complain. Thanks for taking a look at it, btw. It looks like a really good package if we can get it up and running! I guess the difficulty could stem from the way that F9 has implemented PHP and MySQL...I get the impression that it's not a standard type of configuration. Nevertheless, it should be possible to get working!

I'll keep trying and post back with any developments!

FYI: Plone installs on Win2k like a breeze, but has no documentation at all so I can't figure out how to use it!!

Dave
N/A

RE: MySQL and PHP Question

> When I first downloaded it, I decompressed it on >my desktop machine and something wierd happened: >Although Windows Explorer reported that it had a >total file size of ~9MB, it took up ~45MB on the >disk.

Thats due to a little thing called slack space. Basically file systems such as FAT and NTFS (used by windows) used fixed sized allocation units, if a file is larger than one unit then multiple units are used etc. However if a file is smaller than one unit then it still uses one unit (you can't have two files in one allocation unit as far as I know). So if you have 12 1k (1024 bytes) files and your default allocation size is say 4k (4096 bytes) then they will take up 12*4096 bytes (~48k) opposed to 12*1024 bytes. So there is in that case 3072 bytes waste space, thats not re-usable.

Anyway now you know, its just a fact of life, when dealing with lots of small files.
N/A

RE: MySQL and PHP Question

>> Thats due to a little thing called slack space. Basically file systems such as FAT and NTFS (used by windows) used fixed sized allocation units, if a file is larger than one unit then multiple units are used etc.

Ahhh, all makes sense now.
Thanks for your eloquent explanation, Big Al.
N/A

RE: MySQL and PHP Question

> > have you tried to ping crofters?
>
> Good thinking, Richard: I hadn't thought of doing >that. But unfortunately I still get the same error >message. Maybe I need to use a particular port >number? The other thing that's occured to me is >that maybe crofters just doesn't understand >the "mysqladmin" command that the installation >guide tells me to use. I've tried using different >mysqladmin commands such as "mysqladmin ping" but >that doesn't work either.

I found that a lot of mysql commands weren't allowed on rumpus. For example you can't drop tables (well no one from support replied to my question about this a few months ago), which is a pretty big annoyance, if you've had a program auto create some tables that you then want to get rid of. Instead you have to do everything through f9s control panel on the standard portal. However this is ridiculously long winded to do anything with.

In the end I got fed up and went with another hosting company for what I wanted.