473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to configure MySql support?

I've just loaded phpMyAdmin on a Debian Linux server with Apache2, MySql5 and
PHP5.

myserver [/root] # dpkg -l | grep php
ii libapache-mod-php5 5.2.0-8+etch4
ii libapache2-mod-php4 4.4.4-8+etch2
ii php4-common 4.4.4-8+etch2
ii php5-common 5.2.0-8+etch4
ii php5-gd 5.2.0-8+etch4
ii php5-mcrypt 5.2.0-8+etch4
ii php5-mysql 5.2.0-8+etch4
ii phpmyadmin 2.9.1.1-3

myserver [/root] # dpkg -l | grep mysql
ii libdbd-mysql-perl 3.0008-1
ii libmysqlclient15off 5.0.32-7etch1
ii mysql-client-5.0 5.0.32-7etch1
ii mysql-common 5.0.32-7etch1
ii mysql-server 5.0.32-7etch1
ii mysql-server-5.0 5.0.32-7etch1
ii php5-mysql 5.2.0-8+etch4
When I try to use phpMyAdmin, I get an error:

"Cannot load mysql extension. Please check your PHP configuration."

There's a link in the error that points to http://us.php.net/mysql, which says:

Use the --with-mysql[=DIR] configure option to include MySQL support.

But in the above package list, it shows "php5-mysql" is already installed. Do I
need to add this module to PHP? How?

Can someone please help me understand how to configure PHP with MySql support?

Many thanks.

Jun 5 '07 #1
8 7069
deko wrote:
I've just loaded phpMyAdmin on a Debian Linux server with Apache2,
MySql5 and PHP5.

myserver [/root] # dpkg -l | grep php
ii libapache-mod-php5 5.2.0-8+etch4
ii libapache2-mod-php4 4.4.4-8+etch2
ii php4-common 4.4.4-8+etch2
ii php5-common 5.2.0-8+etch4
ii php5-gd 5.2.0-8+etch4
ii php5-mcrypt 5.2.0-8+etch4
ii php5-mysql 5.2.0-8+etch4
ii phpmyadmin 2.9.1.1-3

myserver [/root] # dpkg -l | grep mysql
ii libdbd-mysql-perl 3.0008-1
ii libmysqlclient15off 5.0.32-7etch1
ii mysql-client-5.0 5.0.32-7etch1
ii mysql-common 5.0.32-7etch1
ii mysql-server 5.0.32-7etch1
ii mysql-server-5.0 5.0.32-7etch1
ii php5-mysql 5.2.0-8+etch4
When I try to use phpMyAdmin, I get an error:

"Cannot load mysql extension. Please check your PHP configuration."

There's a link in the error that points to http://us.php.net/mysql,
which says:

Use the --with-mysql[=DIR] configure option to include MySQL support.

But in the above package list, it shows "php5-mysql" is already
installed. Do I need to add this module to PHP? How?

Can someone please help me understand how to configure PHP with MySql
support?

Many thanks.
First of all, what does phpinfo() say about MySQL support? It's the
only authoritative answer.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 5 '07 #2
deko wrote:
ii libapache-mod-php5 5.2.0-8+etch4
ii libapache2-mod-php4 4.4.4-8+etch2
ii php4-common 4.4.4-8+etch2
ii php5-common 5.2.0-8+etch4
ii php5-mysql 5.2.0-8+etch4
I've snipped out some of the irrelevant packages. Note you have two copies
of PHP installed -- PHP4 and PHP5. You only have the MySQL extension
installed for PHP5, not PHP4. So if your script is running in a PHP4
environment, then the MySQL functions will not work.

I'd recommend removing php4-common and libapache2-mod-php4, and then
installing libapache2-mod-php5 if such a beast exists. Then try.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 102 days, 1:11.]

URLs in demiblog
http://tobyinkster.co.uk/blog/2007/05/31/demiblog-urls/
Jun 5 '07 #3
>ii libapache-mod-php5 5.2.0-8+etch4
>ii libapache2-mod-php4 4.4.4-8+etch2
ii php4-common 4.4.4-8+etch2
ii php5-common 5.2.0-8+etch4
ii php5-mysql 5.2.0-8+etch4

I've snipped out some of the irrelevant packages. Note you have two copies
of PHP installed -- PHP4 and PHP5. You only have the MySQL extension
installed for PHP5, not PHP4. So if your script is running in a PHP4
environment, then the MySQL functions will not work.

I'd recommend removing php4-common and libapache2-mod-php4, and then
installing libapache2-mod-php5 if such a beast exists. Then try.
Great! Thanks for the tip. I've been trying to build a Debian LAMP server with
Samba and phpMyAdmin. I think I've got everything completed except the PHP
configuration. Apparently, PHP5 does not come with Debian Etch by default, and
PHP does not come with MySql support by default.

Debian is great, but all the install/configure tasks are not well documented as
much is distro-specific. But I did get Apache and Samba working. MySql appears
to be installed by default.

Jun 7 '07 #4
deko wrote:
Apparently, PHP5 does not come with Debian Etch by default,
Really?

What sources have you got configured for packages? Are they all "stable"?
If so, add some "testing" sources in, and see if PHP5 is available for
install.

Debian is notorious for including fairly old versions of packages in its
"stable" branch. The "testing" branch has a lot more polish and stability
than its name gives it credit for, and is perfectly suitable for a
production server.

Try:
apt-get install apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 103 days, 19:57.]

URLs in demiblog
http://tobyinkster.co.uk/blog/2007/05/31/demiblog-urls/
Jun 7 '07 #5
I'd recommend removing php4-common and libapache2-mod-php4, and then
installing libapache2-mod-php5 if such a beast exists. Then try.
After using 'dpkg -r' and 'dpkg --purge', I ended up with this

bubba [/root] # dpkg -l | grep php
ii libapache-mod-php5 5.2.0-8+etch4
ii php5-common 5.2.0-8+etch4
ii php5-gd 5.2.0-8+etch4
ii php5-mcrypt 5.2.0-8+etch4
ii php5-mysql 5.2.0-8+etch4
ii phpmyadmin 2.9.1.1-3

There is a libapache2-mod-php5, but not sure if I need this:
http://packages.debian.org/unstable/...ache2-mod-php5

How do I add php5 to apache? If I issue the a2enmod command, I get a list of
module names that I could enable - the problem is I don't see php5 in the list.

Jun 8 '07 #6
deko wrote:
bubba [/root] # dpkg -l | grep php
ii libapache-mod-php5 5.2.0-8+etch4
ii php5-common 5.2.0-8+etch4
ii php5-gd 5.2.0-8+etch4
ii php5-mcrypt 5.2.0-8+etch4
ii php5-mysql 5.2.0-8+etch4
ii phpmyadmin 2.9.1.1-3

There is a libapache2-mod-php5, but not sure if I need this:
http://packages.debian.org/unstable/...ache2-mod-php5
dpkg -l | grep apache

See which version of Apache you are using. Apache 1.3 and Apache 2.x are
both fairly common -- Debian provides packages of each. (Most distros do.)

If you're running Apache 1.x, then use libapache-mod-php5;
if you're running Apache 2.x, then use libapache2-mod-php5.

If you seem to have both Apache 1.3 *and* Apache 2.x installed, then
uninstall one of them -- you'll only end up confusing yourself!

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 104 days, 17:28.]

URLs in demiblog
http://tobyinkster.co.uk/blog/2007/05/31/demiblog-urls/
Jun 8 '07 #7
dpkg -l | grep apache
>
See which version of Apache you are using. Apache 1.3 and Apache 2.x are
both fairly common -- Debian provides packages of each. (Most distros do.)
myserver [/root] # dpkg -l | grep php
ii libapache2-mod-php5 5.2.0-8+etch4
ii php5 5.2.0-8+etch4
ii php5-common 5.2.0-8+etch4
ii php5-gd 5.2.0-8+etch4
ii php5-mcrypt 5.2.0-8+etch4
ii php5-mysql 5.2.0-8+etch4
ii phpmyadmin 2.9.1.1-3
myserver [root] # dpkg -l | grep apache
rc apache-common 1.3.34-4.1 *<<=== what does 'rc' mean? *
ii apache2-doc 2.2.3-4
ii apache2-mpm-prefork 2.2.3-4
ii apache2-utils 2.2.3-4
ii apache2.2-common 2.2.3-4
ii libapache2-mod-perl2 2.0.2-2.4
ii libapache2-mod-php5 5.2.0-8+etch4
ii libapache2-mod-python 3.2.10-4
myserver [/root] # apache2ctl -t -D DUMP_MODULES
Loaded Modules:
core_module (static)
log_config_module (static)
logio_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
alias_module (shared)
auth_basic_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgi_module (shared)
dir_module (shared)
env_module (shared)
mime_module (shared)
python_module (shared)
negotiation_module (shared)
perl_module (shared)
php5_module (shared)
setenvif_module (shared)
status_module (shared)
Syntax OK
myserver [/root] # mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.32-Debian_7etch1-log Debian etch distribution

================================================== =

The problems now are:

-- blank page when accessing phpinfo.php
I tried adding 'AddType application/x-httpd-php .php' to my apache2.conf file
(and restarting apache), but no luck.
Do I have to recompile apache?

--Error when trying to access phpMyAdmin:
Error: 'The configuration file now needs a secret passphrase (blowfish_secret).'
I tried modifying config.inc.php by uncommenting this line:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
but no luck.

Don't I need some mysql apache module loaded?
How do I tell apache2 to load a module?

Jun 9 '07 #8
got it working:

myserver [/etc/phpmyadmin] # vi config.inc.php
<?php
$i = 0;
$i++;
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port (leave blank for
default port)
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method: config,
http, or cookie
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password
?>

myserver [/usr/share/phpmyadmin] # vi phpinfo.php
<?php
phpinfo();
?>

For some reason the default phpinfo.php does not work - just returns a blank
page.

Getting the correct packages installed was half the battle... understanding the
Debian packaging system (apt, aptitude, dpkg, dselect) and knowing how to
configure everything with all the Debian Etch platform-specific peculiarities...
all without documentation.

Jun 10 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: compu_global_hyper_mega_net_2 | last post by:
Greetings, usenet's obviously dying. Where's everyone hanging out? One of the yahoo groups or something? anyway. Hopefully someone picks this up: I'm trying to compile php-5.0.0RC2 with...
0
by: Roy Shaw | last post by:
When configuring PHP5 (5.0.3) to use the mysqli libraries I get a "No such file or directory" from the configure script. My goal is to get PHP5 running with mysql 4.1.09 with both the mysql and...
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
9
by: ibm_97 | last post by:
Hi all, Red Hat Advanced Server 3.0 Apache 2.0.54 PHP 5.0.4 MySql 4 When I tried to 'configure' with MySql support, it failed: #./configure --with-apxs2=/usr/local/apache2/bin/apxs
7
by: Brent Halsey | last post by:
Hi All, I am trying to configure php with IBM-DB2 and I get the following error: checking for IBM DB2 support... no configure: error: build test failed. Please check the config.log for...
3
by: doctorhardik | last post by:
hai all i am try configure php4.3.9 on my FC-3 machine. and my mysql database version 5.0.1, in phpinfo file it show mysql but when i run php -v command it show error like
0
by: doctorhardik | last post by:
hai all i have Fedora3. i am trying to configure mysql5.0.1 with php4.3.9. when i configure php with --with-mysql=shared,/usr i get mysql.so file. but in phpinfo page i am not find mysql. ...
1
by: Jim McCullars | last post by:
Greetings: Getting configure errors trying to build PHP 5.2.5 under Solaris 9. The configure command I use is this: ../configure --with-mysql --with-gd --with-jpeg-dir=/usr/local...
1
by: gquiring | last post by:
I have a new server running CentOS 5.1. I was surprised the stock PHP excludes MySQL, PDO and a bunch of other popular modules. I decided to download the source and compile a version with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.