Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-05-2004, 04:57 AM   #1
Registered: Aug 2003
Location: South Africa
Distribution: mandrake 9.1
Posts: 36

Rep: Reputation: 15
confused on php and Mysql install

i am usin MDK 10 CE, i first installed apache and PHP. that worked but now wanted to start using a Mysql database. so i installed the Mysql client and server packages and also something called php-mysql... which i thought would be necessary.

i configured Mysql using webmin(gave permissions and started the server)

yet when run a php script it gives a parser error on the line that i want to connect to the server(localhost).
it cant be my syntax since i copied it directly from a tutorial and from past tutorials i read it looks correct to me.

is there something i should have configured after the installation using URPMI?

Old 11-05-2004, 08:22 AM   #2
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
If it's a parse error.... then it's most likely syntax. Though you MIGHT get a parse error if php was not compiled with mysql support. Write a script with
<?PHP phpinfo(); ?>
and look at the configure options and look for mysql support.
Old 11-05-2004, 08:48 AM   #3
Registered: Aug 2003
Location: South Africa
Distribution: mandrake 9.1
Posts: 36

Original Poster
Rep: Reputation: 15
thanks for the reply

i installed using the Mandrake Control Center so i just selected the rpms after a search and clicked install.

i did a phpinfo.php in my browser and the word "Mysql" came up only once when i did a search. it was listing a bunch of configure possiblities

is that correct then?

If it is a syntax error then what is the correct syntax to connect to localhost?
Old 11-05-2004, 01:36 PM   #4
Registered: Apr 2004
Location: Outer space :D
Distribution: Gentoo 2005.0 amd64 2.6.14-dfx3
Posts: 203

Rep: Reputation: 30
Make sure you have the apache2-auth_mysql or mod-auth_mysql packages for the apache webserver (I'm not sure I got their names exactly, but they're something like auth mysql).

This is needed so the server can authentify with the MySQL server when it opens up a connection or something like this. Check if you have this package installed, if it is, add this after the phpinfo():

$link = mysql_connect("serverIP","Username","pwd");
if (!$link) die(mysql_error());

Where username/pwd is optional as I recall. Do a refresh on the page and check the bottom if you get any output. If there's no line saying "error...", the script worked and estabilished a connection with MySQL.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What to type in apt-get install to install mysql PHP libraries sarajevo Debian 1 09-29-2005 05:40 AM
MySQL 4 on Fedora can't install php-mysql kennyg Linux - Software 8 09-21-2004 06:54 PM
PHP install --with-mysql zaichik Linux - Newbie 18 05-26-2004 04:53 PM
MySql-Php install PatC Linux - Newbie 4 07-02-2002 11:36 AM
How to install php and mysql supersunny Linux - Software 1 09-04-2001 10:28 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration