Web Hosting Talk







View Full Version : php & Mysql help


Franki
08-04-2001, 09:41 PM
Hello guys. I need help with php and mySQL. I have a RaQ4i and I have pre-installed php4. I have also installed Cobalt MySQL Release 3.23.36-1 . I want two things: 1) How can I run .php pages? Do I have to connect php to mySQL? 2) Any good web program for administrating mySQL? I know phpMyAdmin but I firstly have to do the (1) step...

ffeingol
08-04-2001, 09:51 PM
Hello,

As long as you activate PHP for a site, .php pages should work. To check it out, create a page with the fillowing info:


<?php phpinfo ?>


Browse that page then, It should show you all the information about PHP.

You don't really do anyting to "connect" php to mysql. In your php script, you have to code mysql calls to log into the database, select the database, issue sql and fetch the results back.

Feel free to contact me if you need more info.

Frank

mikeknoxv
08-04-2001, 11:12 PM
phpMyAdmin is the best open-source software you're going to find, at least in that area. Be sure to enable PHP for your site through the Cobalt control panel.

Haisoft
08-06-2001, 04:50 PM
I've tried phpmyadmin, but dont know where to look for localhost,
($cfgServers[1]['host'] = 'localhost'; // MySQL hostname)
I've tried quite a few different ones but none of them seem to be the right ones, I keep geting a warning message saying that it can't access msql host,

Richard

mikeknoxv
08-06-2001, 05:10 PM
Are you sure MySQL is running?

Reg
08-06-2001, 05:19 PM
You may have a problem that a lot of PHP/mySQL users are being faced with. PHP has to be "built" into mySQL. Most RaQ4's do not come with mySQL installed so it has to be installed seperately. The PHP installation documentation say to install mySQL first then configure PHP with mySQL during the PHP installation. My advice is to read through the PHP documentation on how to build PHP into mySQL after PHP was installed first.

Haisoft
08-06-2001, 05:34 PM
Originally posted by mikeknoxv
Are you sure MySQL is running?
I'm sure msql is installed and I have created a database aswell but, what I'm not sure about is what you are ment to replace "localhost" by in phpmyadmin,
Richard

ffeingol
08-06-2001, 05:52 PM
Normally, you just leave localhost as localhost. The only time it would be something different is if your mysql server is running on a different unix host.

Frank

Franki
08-06-2001, 06:40 PM
I had the same problem with phpMyAdmin. You must leave it 'localhost' to make phpMyAdmin work.

Haisoft
08-07-2001, 08:58 AM
I have done this, but I still get a warning message, even though it's not the same one.
Have a look if you want :
http://www.sql.haisoft.co.uk/mysql
Username : admin
Password: test123

Richard

ffeingol
08-07-2001, 09:57 AM
Sorry, I get a page not found when I follow your link.

Is it a message about GPC Magic quotes?

Frank

Haisoft
08-07-2001, 01:03 PM
Sorry I made a mistake in the link, there is no www !
New Link : http://sql.haisoft.co.uk/mysql

Richard

pistoner
08-07-2001, 01:16 PM
where did u get mysql software? i recommend u download mysql from pkg.nl.cobalt.com.

ffeingol
08-07-2001, 01:18 PM
OK, this is the error I received:

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)

That type of an error usually means that your mysql server is not running.

If you are on a unix box and you can telnet/ssh in type:

ps -ef | egrep mysql


That runs a unix ps command to see the running processes. It then pipes it through grep to search for the string mysql.

If mysql is running, you would normally see a like like "safe_mysqld". If it comes back with nothing, then mysql is not running.

Frank

Haisoft
08-07-2001, 01:21 PM
mysql was already installed on the server along with other databases when our server was first set up by host europe,
I think that it should work. Any way I've read in the forum that there can be a problem when mysql is installed after php and that php otherwise mysql needs to be built into mysql.
I don't know,

Richard

ffeingol
08-07-2001, 01:26 PM
Mysql is installed, but are you sure it's running (sorry to be redundant). The PHP that comes with a RaQ is compiled with MySQL support.

Frank

Haisoft
08-07-2001, 01:26 PM
I've got telnet acces but my coleague is on holiday and I'm replacing him, how do you acces telnet, do you acces it under dos?,
Richard

ffeingol
08-07-2001, 01:31 PM
Sorry, I don't know how to do it from DOS. From Windows, just enter telent in a run command.

Frank

Haisoft
08-07-2001, 01:47 PM
The reply is :
admin 23629 23538 0 18:39 pts/ 0 00:00:00 egrep mysql
Is that any help why it doesn't work?

Richard

ffeingol
08-07-2001, 01:59 PM
Yep, that means that mysql is not running. You're just seeing the grep command show it. It should look something like this:


root 465 1 0 Aug02 ? 00:00:00 sh /usr/bin/safe_mysqld --datadi
mysql 499 465 0 Aug02 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --d
mysql 504 499 0 Aug02 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --d
mysql 505 504 0 Aug02 ? 00:00:00 /usr/sbin/mysqld --basedir=/ --d
admin 32343 32327 0 12:53 pts/0 00:00:00 egrep mysql


You'll need root access to restart it. The normal command to restart it is:

/etc/rc.d/init.d/mysql start

Frank

Haisoft
08-07-2001, 02:17 PM
Doesn't work, says no such file, had a look with ftp in init.d and no file called mysql
Were can I find the right one?
I heve found the path for odcb driver:
/home/chiliasp/odbc/opensource/lib/libmyodbc.so
is this of any help? Richard

Haisoft
08-07-2001, 02:25 PM
I wasn't in the right starting directory, it now says bash : mysql : command not found


Richard

ffeingol
08-07-2001, 02:25 PM
Again, sorry to be redundant, but are you sure MySQL was installed on the RaQ? The .pkg file will install/create that startup file.

You can verify that the pack was installed by doing the following:

login to your admin page
Click Maintenance
Click Install Software


There should be a list of software installed. On the server I admin, I see the following line:

Cobalt MySQL Release 3.23.37-1

The saga continues... :D

Frank

ffeingol
08-07-2001, 02:27 PM
Sorry, you're replying faster than I can :D

Did you try to start it as root? When you su'ed to root did you do:

su -

Frank

Haisoft
08-07-2001, 02:30 PM
You are right it's not in the list but how come it is in the asp bit?
I even set up a data base with it !
Will it harm the server if I try and install it with the pkg file if ever is is already installed in one of the security releases?
Richard

Haisoft
08-07-2001, 02:33 PM
Originally posted by ffeingol
Sorry, you're replying faster than I can :D

Did you try to start it as root? When you su'ed to root did you do:

su -

Frank

Yes I did (I even did it cd by cd )

ffeingol
08-07-2001, 02:42 PM
Originally posted by Haisoft
Will it harm the server if I try and install it with the pkg file if ever is is already installed in one of the security releases?
Richard

Sorry, I cannot answer that. I don't know.

Frank