473,739 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 libmysqlclient1 5off 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 7096
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 libmysqlclient1 5off 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*******@attgl obal.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_modu le (static)
logio_module (static)
mpm_prefork_mod ule (static)
http_module (static)
so_module (static)
alias_module (shared)
auth_basic_modu le (shared)
authn_file_modu le (shared)
authz_default_m odule (shared)
authz_groupfile _module (shared)
authz_host_modu le (shared)
authz_user_modu le (shared)
autoindex_modul e (shared)
cgi_module (shared)
dir_module (shared)
env_module (shared)
mime_module (shared)
python_module (shared)
negotiation_mod ule (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_secre t).'
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
1797
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 tidy support. ../configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs
0
2138
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 mysqli options. I can get it to configure and work correctly with just the mysql but NOT the mysqli or both. Environment: Red Hat Enterprise Linux 3, rel 4 php 5.0.3 from sources from php.net
16
27922
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 own LAN, the driver tells me it cannot make the connection. Here are the ODBC driver connection parms: Data Source Name: (free field - name my "my linux box" will do nicely) Host/Server Name (or IP) - something like MSQLUserName@ServerName.net...
9
2381
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
7864
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 details. You need to source your DB2 environment before running PHP configure: # . $IBM_DB2/db2profile
3
2946
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
1141
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. when i configure php with --with-mysql=/usr i am not get mysql.so file. bec i am
1
3593
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 --with-png-dir=/usr/local --with-zlib-dir=/usr/local --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local and I get this error:
1
2633
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 modules I need but I used the phpinfo() configure option and modified my changes. What I don't get is stock configure (no changes) won't compile on my box. For example in the configure is --with-apxs2=/usr/ sbin/apxs'. I don't even have that...
0
9479
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6054
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3280
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.