TestLink Tutorial TestLink Tutorials On this page, we will learn to enable MySQL extensions in php.ini for the TestLink application. If we are configuring and installing the TestLink
application manually, we need to enable MySQL in the PHP configuration. Warning! Your PHP installation don’t have the MySQL extension mysql- without it is impossible to use TestLink.Introduction
Error Indication
php.ini setting
We can enable the MySQL modules in the php.ini configuration file. Locate the configuration file on the machine hard disk.
Open the file with an editor.
Enable or add the following configuration parameters to the file.
extension=mysqli
extension=pdo_mysql
MySQL extensions are .dll files on the Windows environment that are located in the ext folder of the PHP installation directory. We need to make sure to set the extension_dir directive to reflect the changes.
For example:
; On windows: extension_dir = "c:\php\ext"
I am trying to load a MySql extension for PHP development.
Running I can see that the MySql extension is not loaded. This is also apparent when running a script that uses the
mysql_connect
function and receiving the error Fatal error: Call to undefined function mysql_connect[] in C:\Apache24\htdocs\test.php on line 11
.
Running php --ini
I receive an output of:
Loaded Configuration File: C:\php\php.ini
Scan for additional .ini files in: [none]
Additional .ini files parsed: [none]
So when I edit my php.ini file in order to enable the MySql extension I know I am editing the correct .ini file. The output of phpinfo[]
points to the same file.
In my php.ini file I have changed
;extension=php_mysql.dll
to
extension=php_mysql.dll
For my extension directory in my php.ini file:
extension_dir = "./ext"
within that directory I do have the php_mysql.dll
file.
I am at a bit of a loss here and don't really know what I am missing. Every answer I have found on the SE sites and elsewhere just point to uncommenting a line in the php.ini file and checking that the extension_dir is pointing to a location that contains the correct .dll file.
What am I missing to properly load this extension?
Any assistance would be much appreciated.
I installed everything separately [Apache, PHP, MySQL and phpMyAdmin] and do not use a compilation, everything works fine till now except phpMyAdmin.
The problem I am experiencing is, that the error message states that the "MySQL extension is missing", as soon as I try to call up:
localhost/phpmyadmin/index.php
And when I call up
localhost/phpmyadmin/setup/index.php
I have two messages where I do not know if it is supposed to be like that:
Bzip2 compression and decompression requires functions [bzopen, bzcompress] which are unavailable on this system.
and:
Zip decompression requires functions [zip_open] which are unavailable on this system.
Any suggestions?
hakre
187k48 gold badges418 silver badges801 bronze badges
asked Nov 22, 2011 at 10:20
1
At first make sure you have mysql installed properly. You can ensure it just by checking that whether you can access mysql using mysql command promp. So if you mysql is working then probably it is not loading. For that follow the steps given below
First of all, you must find your php.ini. It could be anywhere but if you create a small php file with the
script it will tell you where it is. Just look at the path of loaded configuration file. Common places include /etc/apache/, /etc/php4/apache2/php.ini, /etc/php5/apache2/php.ini or even /usr/local/lib/php.ini for Windows it may be C:\Users\username\PHP\php.ini
Edit your server’s php.ini and look for the following line. Remove the ‘;’ from the start of the line and restart Apache. Things should work fine now!
;extension=mysql.so
should become
extension=mysql.so
For windows it will be
;extension=mysql.dll
should become
extension=mysql.dll
answered Nov 22, 2011 at 10:42
Alim Ul GiasAlim Ul Gias
5,8612 gold badges27 silver badges39 bronze badges
1
Some linux distributions have a php_mysql and php_mysqli package to install.
Martin B
23.1k6 gold badges52 silver badges71 bronze badges
answered Nov 22, 2011 at 10:23
Ivan ButtinoniIvan Buttinoni
3,9821 gold badge21 silver badges39 bronze badges
You need to put the full path in the php ini when loading the mysql dll, i.e :-
extension=c:/php54/ext/php_mbstring.dll
extension=c:/php54/ext/php_mysql.dll
Then you don't need to move them to the windows folder.
Thiem Nguyen
6,3057 gold badges29 silver badges50 bronze badges
answered Jun 24, 2012 at 16:01
Gavin SimpsonGavin Simpson
2,7133 gold badges29 silver badges36 bronze badges
1
In my case I had to install the extension:
yum install php php-mysql httpd
and then restart apache:
service httpd restart
That solved the problem.
answered Aug 13, 2012 at 16:27
KalenGiKalenGi
1,7144 gold badges25 silver badges37 bronze badges
Just as others stated you need to remove the ';
' from:
;extension=php_mysql.dll
and
;extension=php_mysqli.dll
in your php.ini to enable mysql and mysqli extensions. But MOST IMPORTANT of all, you should set the extension_dir
in your php.ini to point to your extensions directory. The default most of the time is "ext
". You should change it to the
absolute path to the extensions folder. i.e. if you have your xampp installed on drive C, then C:/xampp/php/ext
is the absolute path to the ext folder, and It should work like a charm!
answered Mar 21, 2015 at 8:27
I just add
apt-get install php5-mysqlnd
This will ask to overwrite mysql.so from "php5-mysql".
This work for me.
Mark Amery
131k78 gold badges392 silver badges441 bronze badges
answered Sep 17, 2016 at 10:14
Installing bzip2
and zip
PHP extensions solved my issue in Ubuntu:
sudo apt-get install php7.0-bz2
sudo apt-get install php7.0-zip
Use php[you version]-[extension]
to install and enable any missing modules that is required in the phpmyadmin readme.
answered Mar 19, 2017 at 1:13
Hafez DivandariHafez Divandari
7,7314 gold badges40 silver badges57 bronze badges
1
Your installation is missing some php modules, there should be a list of required modules in the phpmyadmin readme. If you recently enabled the modules, try restarting the apache service / daemon.
Edit: As it seems, there is no single "enable these modules" in
the docs, so enable either mysql
or mysqli
in your php.ini [you might need to install it first].
The two messages are not important if you do not intend to upload or download compressed file within phpMyAdmin. If you do, enable the zlib
and / or bz2
modules.
answered Nov 22, 2011 at 10:23
Stephan BStephan B
3,62119 silver badges33 bronze badges
I had a similar issue, but it didn't help to add extension=mysql.so in my php.ini. It turned out that the mysql.so file was not in my extension folder nor anywhere else on my machine. Solved this by downloading the php source and building the extension manually and then copying it into the extension folder.
answered Aug 7, 2017 at 10:26
DagliglederDagligleder
4415 silver badges13 bronze badges
Just check your php.ini file, In this file Semicolon[;] used for comment if you see then remove semicolon ;.
;extension=mysql.dll
Now your extension is enable but you need to restart appache
extension=mysql.dll
answered Nov 23, 2011 at 8:04
1