LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   PHP problem (https://www.linuxquestions.org/questions/linux-newbie-8/php-problem-703308/)

methoxcy 02-09-2009 04:58 AM

PHP problem
 
I have an error encountered in my PHP it seems that i need to install PHP with mysql support. I have an existing PHP5 and Mysql and i dont know if my mysql have a support. how can i do that php5 w/ mysql support?? can anyone teach me the step by step im only newbie and i dont have any idea whats going on but i really need this.. Could anyone help me bout my problem?..tnx a lot

rsciw 02-09-2009 05:00 AM

what does the output of

<?php
phpinfo();
?>

say regarding mysql?

linuxlover.chaitanya 02-09-2009 05:05 AM

Usually php has mysql support by default. You could look in /etc/php.ini and
/etc/php.d/mysql.ini for more info.
Also phpinfo function will give you the required information.

r3sistance 02-09-2009 05:07 AM

Not always, my server had MySQL and PHP but lacked the php-mysql module and thus PHP failed to communicate with MySQL

Distribution would also help to know. I'd suggest a missing MySQL module for PHP, which is very very easy to fix with a package manager.

General Failure 02-09-2009 05:07 AM

Did you check that mysql is running? Running
Code:

ps aux | grep mysql
will show you if mysql is running. If the commands give no output, it isn't, so you'd have to make it start automatically on boot. Besides, it is necessary to setup mysql before using it (create tables/users...). Just refer to your distro's documentation to see how to do that, these are standard tasks that I assume will be documented there.

selva146 02-09-2009 11:53 AM

if it is redhat or fedora, u can use rpm to check whether php-mysql module is installed.

rpm -q php-mysql

methoxcy 02-09-2009 07:02 PM

PHP error.
 
YOYO123Fullname:
Fatal error: Call to undefined function mysql_connect() in /var/www/html/GetTime2.php on line 63

this is the I saw in my php info... what should i do??

linuxlover.chaitanya 02-09-2009 11:39 PM

Look at line 63. What does it say? Without the code no one here can tell you what went wrong with your code.
Also post the contents of file /etc/php.d/mysql.ini

r3sistance 02-10-2009 04:47 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3437943)
Without the code no one here can tell you what went wrong with your code.

Apart from it says "undefined function" what is a good indicator that PHP does not understand the function. He needs to install the php-mysql module, however until we know what distribution it is, can not tell him the easiest method to do it.

linuxlover.chaitanya 02-10-2009 05:26 AM

Thats why the contents of the file that I said. If it has got the php-mysql module installed it will have the extension=mysql.so or something there.

If the distro is Debian based or Ubuntu like
sudo apt-get install php-mysql should do it.

If it is something else Fedora or RH or CentOS
yum install php-mysql should do it.

Or else find the binary package if available and install.


All times are GMT -5. The time now is 08:40 AM.