php cannot connect to mysql
I just installed Ubuntu 10.10 LTS. I installed the LAMP package. For some reason php cannot connect to mysql. I have written a very simple php program to isolate the problem. My php program fails when I execute the ADONewConnectio
$host = 'localhost';
$user = 'smansfie';
$passwd = 'xxxxx_xxxx';
$database = 'acregistration';
$DB = ADONewConnectio
I did a 'ps aux | grep mysql' and got,
mysql 727 1.0 2.3 188180 24000? Ssl 10:50 0:00 /usr/sbin/mysqld
Plus I can log into mysql with no problems so I am pretty sure mysql is at least running. I did see an earlier posting with the same probelm. The fix was to include a statement in the file /etc/mysql/my.cnf 'skip-grant-
ii libapache2-mod-php5
ii php5-adodb
ii php5-cli
ii php5-common
ii php5-mysql
Anyone seen this problem?. Any ideas or suggestions? Debug strategies welcome.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu php5 Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Hilario J. Montoliu (hjmf)
- Solved:
- 2011-01-07
- Last query:
- 2011-01-07
- Last reply:
- 2011-01-07
Hi Stephen Mansfield,
You might get more info in the apache2 logs (/var/log/apache2/)
HTH
Ok I took HTH's advice and checked /var/log/
Several errors were posted but it looks like it cannot find include(
Stephen Mansfield
Need some help...I included /usr/share/
[Fri Jan 07 13:04:43 2011] [notice] Apache/2.2.16 (Ubuntu) PHP/5.3.
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(): Failed opening 'adodb/
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(): Failed opening 'adodb/
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Fatal error: Call to undefined function NewADOConnection() in /var/www/
[Fri Jan 07 13:07:34 2011] [error] [client 109.230.251.8] File does not exist: /var/www/error
Need some help...I included /usr/share/
[Fri Jan 07 13:04:43 2011] [notice] Apache/2.2.16 (Ubuntu) PHP/5.3.
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(): Failed opening 'adodb/
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Warning: include(): Failed opening 'adodb/
[Fri Jan 07 13:04:57 2011] [error] [client 131.91.19.188] PHP Fatal error: Call to undefined function NewADOConnection() in /var/www/
[Fri Jan 07 13:07:34 2011] [error] [client 109.230.251.8] File does not exist: /var/www/error
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
El 07/01/11 19:25, Stephen Mansfield escribió:
> Need some help...I included /usr/share/
> command but did not fix the problem. I have pasted the error message
> below. Does anyone know where adodb/adodb.inc.php is located?
Probably you are trying to execute something missing. You'll need to
install the dependences your program needs
HTH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAk0
1pgAnRrRO9T3GjG
=C+se
-----END PGP SIGNATURE-----
I am clearly missig something. I did check my dependancies. I am not saying that I am 100% correct in checking the dependancies. It's just that I am stuck. I have been working on this problem for 3 days and I am running out of what to check. Does anyone know where adodb/adodb.inc.php is located?
Ok, HTH saved the day. The root problem as stated above was that PHP could not find 'adodb/
I then installed libphp-adodb with the following command,
sudo apt-get install libphp-adodb
That was it...It fixed the problem. I appreciate everyone's help.
Thanks,
Steve Mansfield
Thanks Hilario J. Montoliu (hjmf), that solved my question.
Hi Steve
I am so glad you posted this problem and its solution. I was having exactly the same issue. i am going to try your solution and see if it works for me.
thanks and regards,
andrew
Hello Andrew,
Sorry for the late response. I am transitioning to a new notebook and have
not gotten all my email settled yet. Make sure you check around some of the
other blogs on this problem. I spent about 4 days trying to figure it out.
Make sure that your php daemon is running. If you go on the php site there
is info on how to check to make sure php is up and running. Also make sure
sql is working. You should be at least able to log into mysql and set up a
database. Finally check to make sure using that the daemon is actually not
running by typing ps aux | grep mysql. If the daemon is not running you
will not see any sql daemons running. Don't be fooled by the actual ps
command daemon that has mysql in the argument. My issue was the 4 files
that were not installed by the ubuntu installer as highligted in my posting.
It's been about 3 months since I worked on this problem so some of it is a
little fuzzy. By the way 10.10LTS is a good ubuntu release. I was using
10.04LTS and had a number of problems. I actually stopped using ubuntu for
3 or 4 months until the 10.10LTS release came out. I have not checked what
the latest releases are but again check the blogs to verify what kind of
experience people are having with ubuntu. Word on the blogs is they have a
new guy managing the releases. The quality of the releases under his
management has not been good. Good luck.
Regards,
Steve Mansfield
-----Original Message-----
From: andrew prudente
Sent: Wednesday, March 23, 2011 7:54 PM
To: <email address hidden>
Subject: Re: [Question #140562]: php cannot connect to mysql
Your question #140562 on php5 in Ubuntu changed:
https:/
andrew prudente posted a new comment:
Hi Steve
I am so glad you posted this problem and its solution. I was having
exactly the same issue. i am going to try your solution and see if it
works for me.
thanks and regards,
andrew
--
You received this question notification because you are a direct
subscriber of the question.
Hello Andrew,
Sorry for the late response. I am transitioning to a new notebook and have
not gotten all of my email settled yet. Make sure you check around some of
the
other blogs on this problem. I spent about 4 days trying to figure it out.
Make sure that your php daemon is running. If you go on the php site there
is info on how to check to make sure php is up and running. Also make sure
sql is working. You should be at least able to log into mysql and set up a
database. Finally check to make sure using that the daemon is actually not
running by typing ps aux | grep mysql. If the daemon is not running you
will not see any sql daemons running. Don't be fooled by the actual ps
command daemon that has mysql in the argument. My issue was the 4 files
that were not installed by the ubuntu installer as highligted in my posting.
It's been about 3 months since I worked on this problem so some of it is a
little fuzzy. By the way 10.10LTS is a good ubuntu release. I was using
10.04LTS and had a number of problems. I actually stopped using ubuntu for
3 or 4 months until the 10.10LTS release came out. I have not checked what
the latest releases are but again check the blogs to verify what kind of
experience people are having with ubuntu. Word on the blogs is they have a
new guy managing the releases. The quality of the releases under his
management has not been good. Good luck.
Regards,
Steve Mansfield
-----Original Message-----
From: andrew prudente
Sent: Wednesday, March 23, 2011 7:54 PM
To: <email address hidden>
Subject: Re: [Question #140562]: php cannot connect to mysql
Your question #140562 on php5 in Ubuntu changed:
https:/
andrew prudente posted a new comment:
Hi Steve
I am so glad you posted this problem and its solution. I was having
exactly the same issue. i am going to try your solution and see if it
works for me.
thanks and regards,
andrew
--
You received this question notification because you are a direct
subscriber of the question.
Micah Gersten (micahg) said : | #13 |
Please note 10.10 is NOT an LTS release. 12.04 will be the next LTS release.