PHP not supporting mysql_connect()
I have installed debian etch and apache
later downloaded and installed mysql and it is working PHP is also working but when i write code to connect to the mysql i.e $conn=mysql_connect("localhost","root","") Fatal error: Call to undefined function: mysql_connect() in /var/www/apache2-default/sal.php on line 8 where is the problem? is it with apache? mysql? PHP? is is required to apache get compiled after the installation of mysql to support mysql libraries? the mysql is a binary (tgz) version (not source code) which i installed |
Have you installed the php-mysql package? Try running:
Code:
aptitude install php-mysql I'm not a debian user so if that doesn't work try agt-get instead of aptitude. Cheers! |
I don't like to lean towards a particular distro
that is why i installed downloaded mysql from tar binary though it is possible to install it from the installation cd. I would like to do things in a standardised way - i.e The solutions should be applicable to every distro (for example getting packages in tar form is acceptable to all distros also compiling them is acceptable to all systems) How ever I understand that for my problem, the package mysql_php should be installed. I shall try that way But why it is required? What is its function? |
Quote:
Cheers! |
How did you install the PHP? Did it get compiled with mysql support? If you're using Debian, generally you apt-get php5-common, then install php5-mysql. It's not enabled by default (I don't think anyhow).
If you didn't install php from a package manager, you may need to enable it in the php source during the configure stage (although I thought this was now enabled by default). Since there are so many extensions available for PHP, they only enable certain ones by default, and you enable/disable the ones you need. |
Yes : the posting done by eaglek96 is close to my doubt
During configurations set up, we have to enable it. My doubt is that much enough? Is there anything I have to do with apache (means recompilation) What is the order of installation Apache, Mysql, php? |
All times are GMT -5. The time now is 09:55 PM. |