Cant find the database driver for MediaWiki during installing - php

MYSQL and apache server are already installed on my server.
But still I encountered these problem.
I dont understand the terms to compile php with --with-mysql
Where should i compile? i am using window server.
or how to install the mysql.so module??
Checking environment...
Please include all of the lines below
when reporting installation problems.
PHP 5.2.14 installed Could not find a
suitable database driver! For MySQL,
compile PHP using --with-mysql, or
install the mysql.so module For
PostgreSQL, compile PHP using
--with-pgsql, or install the pgsql.so module For SQLite, compile PHP using
--with-pdo_sqlite, or install the pdo_sqlite.so module For MSSQL,
compile PHP using
--with-mssql_not_ready, or install the mssql_not_ready.so module For DB2,
compile PHP using --with-ibm_db2, or
install the ibm_db2.so module For
Oracle, compile PHP using --with-oci8,
or install the oci8.so module

Look in /php_install_dir/extensions. There should be a file named "php_mysql.dll". If so, enable it in php.ini. If not, download the dll, copy it to the extension dir and enable in php.ini. Remember to restart Apache.
See this page for more info (make sure you read the comments).

Changed this in php.ini. Shouldn't the installer have done this for a Windows installation?
; enable_dl = Off
; CHANGED - This is necessary to enable dynamic loading of Windows .dll modules
; The immediate problem was that PHP could not find a database driver for MySQL
enable_dl = On

For PHP: 5.6.10 and MySQL: 5.0.24a
Go to the root folder of PHP installation
Find a file called php.ini-production
Save the file as php.ini
Edit the file and uncomment the following contents
;extension=php_mysqli.dll
;extension_dir = "ext"
and replace it with,
extension= php_mysqli.dll
extension_dir = "D:\Programs\php\ext”

Related

XAMPP 7.2.13 php -ext-int extension error

I am trying to run a basic cake 3.7 application, however after I create a new project I get a You must enable the intl extension to use CakePHP. According to CakePHP, XAMPP comes with intl extension it just needs to to be enabled via php.ini. I enabled the extension and restarted the server and it did not work. I look inside my extensions directory xamppfiles/lib/php/extensions/no-debug-non-zts-20170718 and could not find the required extension. My question is how do install and enable this extension to satisfy the requirement error?
I've just double-checked and indeed Xampp is coming with php_intl.dll (in your /php/ext folder).
You can enable this extension easily in your php.ini file:
Edit php.ini and remove ; on this line ;extension=php_intl.dll
Restart Xampp

PHP extension installed but not loading

I'm trying to install php's ssh2 extension, and having a little bit of difficulty. The file is there, it's just not loading into php.
First, I've installed ssh2 with:
aptitude install libssh2-1-dev libssh2-php
(For what it's worth, I'm running Ubuntu 12.04 on Nginx.)
I can see that ssh2 is loaded using the modules command:
php -m |grep ssh2
ssh2
However, when I run my code, I get an undefined function error.
In my phpinfo() script, I can see that my php installation scans this directory for additional ini files: /etc/php5/fpm/conf.d. Listing the contents of that directory, I can see that my ssh2.ini is there:
ls /etc/php5/fpm/conf.d
mysqli.ini mysql.ini pdo.ini pdo_mysql.ini ssh2.ini
According to phpinfo again, the other four ini files are loaded. SSH2 is not.
I've also tried placing "extension=ssh2.so" directly in my php.ini file - /etc/php5/fpm/php.ini. And yes - I've restarted my nginx server.
Am I missing something else?
Set display_startup_errors = On in you php.ini
Set error_log = '/var/log/php-error.log' in you php.ini
Create error log - touch /var/log/php-error.log
Now, you can restart php5-fpm daemon and lookup in error log any errors with ssh2 module
The answer from Aleksandr was helpful. I was attempting to install a PHP extension for a Plesk build. You need to make the modifications to the Plesk php.ini version that corresponds to the domain (which you can find in the web-based control panel under Tools and Settings). The error log will be located in /var/log/plesk-phpXX-fpm.
Do NOT uncomment the error_log (#2 / #3) as noted above otherwise you won't see the error show up in this location.

APC - Unable to load dynamic library

Here is what I have in my PHP.ini:
extension=php_apc.dll
...
[APC]
apc.enabled = 1
I'm running Apache 2.0.59, PHP version 5.2.3 on Windows Server 2003.
I've already installed XDebug compiled with vc6. Thus, I got the APC version 5.2 vc6. Here are both filenames that I downloaded (and put the *.dll in php/ext/).
php_apc-3.1.5-5.2-vc6-x86.zip
php_apc-3.1.5-5.2-nts-vc6-x86.zip
I got them here.
I've tried rebooting the server and in both cases, I get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library './ext/php_apc.dll' - The specified module could not be found.\r\n in Unknown on line 0
Try using the full drive letter and path to extension_dir in php.ini:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "C:\somedir\php\ext"
And restart Apache after making the change.
(It might very well be something else, but this is the first thing I check on Windows systems -- those pesky filepaths.)
First, I went here
Then, I downloaded Collection of PECL modules for PHP 5.2.3
Then, I extracted the php_apc.dll file and copied it in the ext/ folder
Restarted Apache
It works!
To complete other answers:
Using the non thread safe (NTS) version of the DLL instead of the thread safe one solved the problem for me.
That is, only the NTS version was compatible with my WAMP installation.
You could check this:
Note: On Windows, APC needs a temp path to exist, and be writable by the web server. It checks the TMP, TEMP and USERPROFILE environment variables in that order and finally tries the WINDOWS directory if none of those are set.
http://php.net/manual/en/apc.installation.php
You have to be sure that the DLL has the correct architecture level. I had the same problem trying to load the file from php_apc-3.1.10-5.4-vc6-x86.zip. It didn't work, while the DLL from php_apc-3.1.10-5.3-vc6-x86.zip worked. I don't know how to find the right file without fiddling in the PHP repository though. HTH.
My problem was that I had listed apcu before apc.
extension=apc
extension=apcu
Reordering them so apcu was first, solved my issue.
In my case, I'm using macOS Catalina and was trying to install extension APCU for PHP 5.6.
So i ran below commands:
brew install autoconf
pecl channel-update pecl.php.net
pecl install apcu-4.0.11
At this stage my php5.6 ini got input extension="apcu.so"
But i was getting warning saying the apcu.so wasn't found under
/usr/local/lib/php/pecl/20131226/ directory.
The installer put the apcu.so at /usr/local/Cellar/php#5.6/5.6.40/pecl/20131226/apcu.so
so i copied the apcu.so to the desired directory
cp /usr/local/Cellar/php#5.6/5.6.40/pecl/20131226/apcu.so /usr/local/lib/php/pecl/20131226/
and i'm done.

phpMyAdmin - The MySQL Extension is Missing

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?
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
<?php phpinfo(); ?>
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
Some linux distributions have a php_mysql and php_mysqli package to install.
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.
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.
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!
I just add
apt-get install php5-mysqlnd
This will ask to overwrite mysql.so from "php5-mysql".
This work for me.
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.
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.
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.
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

mysql is not enabled in phpinfo() of php 5.3.1

I am having apache 2.2.14, php 5.3.1 and mysql 5.1.43 installed on vista. I am trying since 2 days to configure php to have mysql enable on phpinfo().
I modified php.ini to have extension_dir = "c:\php\ext"
modified the extension as extension="php_mysql.dll"
added "c:\php" to the "PATH" environment variable and restarted the vista.
after trying many combinations of putting php.ini, php_mysql.dll and libmysql.dll in c drive and/or c:/windows and/or c:/windows/system32 now I am with no options!!
I do restart the apache after each modification. I used libmysql.dll present in mysql installation and that of older php version as php 5.3.1 has no libmysql.dll...
Any help will be appreciated.
Thanks in advance.
You have to edit php.ini and add/uncomment a line to import the php_mysql.dll extention. Search for ;extention=php_mysql.dll and remove the ;. If you find this line without the ; in front of it, you have another problem. If you don't find this line, add it without the ;.
You can also try to put a \ after the extention path: extension_dir="c:\php\ext\"
put php_mysql.dll in the "c:\php\ext" directory (and keep the extension="php_mysql.dll" uncommented [without the leading ;])
Make sure you've edited the right php.ini. In case of doubt
<?php echo 'ini= "', get_cfg_var('cfg_file_path'), '"';
will tell you which one is used by your php installation.
Maybe php tried to load the php-mysql extension and failed because of additional dependencies. That would cause a startup error entry in the error.log.
Which php-build do you use? The php-mysql extension can either use libmysql.dll as transport layer or the new mysqlnd (MySQL native driver) module. You've added c:\php to PATH. That's usually done in order to let windows find libmysql.dll (though it's not necessary, there are other methods which I prefer). If php-mysql depends on libmysql.dll and windows can't find it loading php_mysql.dll will fail.
But if you're using the php.net build of php 5.3.1 the mysql module uses mysqlnd:
Installation on Windows
In the official PHP distributions from 5.3 onwards, MySQL Native Driver is enabled by defaultThis module is built-in in the php.net build. You can test that by calling php -m in a command shell. It prints all built-in modules.
Thanks a lot to the user who said that we have to move the file php.ini to the folder /bin of the Apache server. it resolves me the same problem after more than one week of trying failed methods.
Of course we must uncomment in the file the two lines;
;extension=php_mysql.dll
;extensin_dir="ext"
by removing the semi-colon (;) and by specifying the full path for the extension library php_mysql.dll rather than ext as follows
extension=php_mysql.dll
extensin_dir="c:\Apache22\php53\ext"
For me I installed Apache in the folder c:\Apache22 and PHP in the folder c:\Apache22\php53, you must use your own values.
NOTE: Because mysql_ functions like mysql_connect() become deprecated in PHP 5.5 and above, it is recommended to enable also the library php_mysqli.dll to use functions like mysqli_ (improved version of mysql_ functions). To do that it is simple, you just have to uncomment the line:
;extension=php_mysqli.dll
in the file PHP.ini as follows:
extension=php_mysqli.dll
Update April 7, 2013. Installed Windows 8 on an i7 Quad, HT 8, 3.62GHz, 12GBRAM.. Installed the latest version of MySQL, got it functioning properly. Installed the latest version of Apache Web Server, got it functioning properly. Installed the latest version of PHP, got it functioning properly. MySQL could not connect to the database. The error message was "mysql_connect function undefined". I copied the modified php.ini file into the "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin", and restarted Apache web server... then it all magically started working.!!! I hope this helps somebody with setting up their own Windows MySQL / PHP web server.

Categories