LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-04-2009, 05:52 AM   #1
bisht_mohit
LQ Newbie
 
Registered: Feb 2007
Posts: 8

Rep: Reputation: 0
Question Getting Problem PHP and Mysql


Hi
My database is over Mysql. Now i want to add tables in my web page. I have heard that through PHP in can embed my database in html page.

I have create a little program, but i m not be able to open that file (test.php) in firefox (web browser).
Is i have to install some plugin for php. to view my html page in web?
 
Old 02-04-2009, 05:56 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,193

Rep: Reputation: 123Reputation: 123
What distribution you using? Likelihood is you forgot to install the MySQL module for PHP and so PHP is unable to connect to MySQL. For Red Hat based distributions "yum install php-mysql" should fix this. For different distributions the method will be different to install this.

If you wish to test if you actually have PHP then create a info.php page and include the following code.

<?php
phpinfo();
?>

if this page works then PHP is installed. If it's blank then you also have to install the PHP module for Apache.

Last edited by r3sistance; 02-04-2009 at 06:01 AM.
 
Old 02-05-2009, 02:49 AM   #3
bisht_mohit
LQ Newbie
 
Registered: Feb 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by r3sistance View Post
What distribution you using? Likelihood is you forgot to install the MySQL module for PHP and so PHP is unable to connect to MySQL. For Red Hat based distributions "yum install php-mysql" should fix this. For different distributions the method will be different to install this.

If you wish to test if you actually have PHP then create a info.php page and include the following code.

<?php
phpinfo();
?>

if this page works then PHP is installed. If it's blank then you also have to install the PHP module for Apache.

Yes you are right, I had already use this script
<?php
phpinfo();
?>

And page show be blank output. Please let me know how can i install PHP module for my Apache server.

when i type system-config-packages command its shows mysql-php.
 
Old 02-05-2009, 05:34 AM   #4
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
which linux distribution?
Debian and -based --> apt-get install php5 (as root or sudo apt-get...)

if it is already installed but not properly configured, you need to edit either
httpd.conf
or
apache2.conf
(depending on your distribution...)

and probably php.ini too
 
  


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
mysql and php problem juice99 Linux - Server 0 05-09-2008 03:13 PM
Mysql and PHP problem yunus.raza Linux - Server 3 08-29-2006 04:02 AM
php-mysql dependancy problem after nitemare mysql upgrade. RHEL4 andrewc Red Hat 1 01-03-2006 05:16 PM
MySQL/php problem Basslord1124 Fedora 11 03-06-2005 03:44 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 09:54 PM


All times are GMT -5. The time now is 04:31 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration