LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-05-2004, 04:57 AM   #1
spedsta
Member
 
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?

thanks
 
Old 11-05-2004, 08:22 AM   #2
Matir
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
Code:
<?PHP phpinfo(); ?>
and look at the configure options and look for mysql support.
 
Old 11-05-2004, 08:48 AM   #3
spedsta
Member
 
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
eqxro
Member
 
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:14 AM.

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