Jump to content

Recommended Posts

Hello,

 

Posted in wrong forum and it got moved into MySQL forums, but its more of a PHP question.

 

I'm working on an installer for a CMS and for the pre-install check it needs to check various things. Folder and file write permissions, php version, xml extensions, and MySQL version. Unfortuneatly there's no function or easy way for finding the MySQL version.

 

The only way that I could think of would be to use a type of explode on phpinfo(). I'm still new to PHP so not sure on how I should go about doing this.

abstract your database layer - use the pear DB library...

 

alternatively with your installer - get the user to give database connection details - check the version and have the installer download the appropriate file(s) from yoru own server to allow your application to function.

 

I am a fan of remote installs (that's what I call them any way) it allows you to provide auto updates and ensures that the applications you build have the appropriate technology support.

 

you could even have a checker that when run will check the apps settings and if the dependant database version, platform or php installation has been upgraded it could auto update your entire app...

 

people pay for that kind of quality automated support.

Q: how do u propose to get information from the mysql server without making a connection?

MySQL servers don't need to be hosted on the same computer (and in larger environments, they get to be the only service on a server).

 

only way is to ask the command line util to display wut version it is, but this is limited to if the host allows you to access the commandline mysql tool (if they didnt remove it in the first place).

 

Just make a connection to the server with bogus credentials, than check the error code.

that will tell u if a mysql server is there, if it is ask for user credentials, and recheck the mysql server and get the version.

 

 

I'll say again what I said in previous thread. There is no MySQL server information in phpinfo().

 

mysql

MySQL Support enabled

Active Persistent Links 0

Active Links 0

Client API version 5.1.30

 

Directive Local Value Master Value

mysql.allow_persistent On On

mysql.connect_timeout 60 60

mysql.default_host no value no value

mysql.default_password no value no value

mysql.default_port no value no value

mysql.default_socket no value no value

mysql.default_user no value no value

mysql.max_links Unlimited Unlimited

mysql.max_persistent Unlimited Unlimited

mysql.trace_mode Off Off

 

mysqli

MysqlI Support enabled

Client API library version 5.1.30

Client API header version 5.1.30

MYSQLI_SOCKET /tmp/mysql.sock

 

Directive Local Value Master Value

mysqli.default_host no value no value

mysqli.default_port 3306 3306

mysqli.default_pw no value no value

mysqli.default_socket no value no value

mysqli.default_user no value no value

mysqli.max_links Unlimited Unlimited

mysqli.reconnect Off Off

 

From phpinfo()

That says Client API Version

Not Server Version.

 

The Client Version is not MySQL Version, its the interface PHP uses to connect to the server.

 

Hmm.. I see..

 

I think overall it might be easier if I move the database page before the setup page.

 

1. Language

2. License

3. Setup

4. Database

5. Configure

6. Finish

 

That's the way my steps are currently arranged.

The API version is some indication as to what MySQL server version MIGHT be installed on this host but you can not rely on it.

For example, on my PC phpinfo reports API version 5.0.51, while MySQL server's version is 5.1.31

On my webhost phpinfo reports API 4.1.11 while there is no MySQL server running at this server at all!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.