Fatal error: Call to undefined function mb_detect_encoding() in - php

Hi see this Question all over the place. But the answers did not solve my issue. I am still getting the same problem with:
Fatal error: Call to undefined function mb_detect_encoding() in C:\inetpub\htdocs\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177
I have tried everything and none of it is working for me. I have the php_mbstring.dll enabled:
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll
;Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
I got my Apache HTTP Server 2.2 set up with the php5apache2_2.dll. I even tried making a copy of php.ini to config.ini become some one said that worked for them.

I got past the error by placing a copy of php.ini in C:/windows. Is there any way to change where it looks for that file and others???
Also now have a full blank page when I try to open phpMyAdmin. and one other page that seem to need databases. I dont even know if I have a database
HELP

Related

Cannot connect Mysql-Apache PHP7 Windows10 WITHOUT WAMPP MAMPP EasyPHP

I am a very junior dev working in a small software company.
Since I started 5 daysago I have database connection problems. Everything started from the setting up of my new working environment.
I have now a PC working on windows 10 and I had to install Apache 2.4 and php7 'manually', without using Wampp, Ampp etc. I did it, many times, comparing each line of my configuration and framework lines to those of my colleagues but I am still not able log in my users, to dysplay use the database, etc. In the browser (any) the error message is "Cannot connect to database".
My company uses Mysql workbench (my boss does not like it) and SQLyog (prefered to manage the databases). So I tried to solve the problem installinf phpMyAdmin. I cheked any parameter, the php.ini is good, every file is well located.
When I try to reach index/php/phpmyadmin (we use our own mvc framework) I geta message error sayong thar msqli extension is missing, with this link : http://localhost/phpmyadmin/doc/html/faq.html#faqmysql. Please note that I have this in my php.ini :
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_ftp.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
extension=php_mysql.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
and there is no error in extension_dir = ******/****/
Can you help me please?
Cordially

Install MySQLi and pgsql extensions on PHP 7.0.7

My php.ini extentions section is like as follows
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+)
; extension folders as well as the separate PECL DLL download (PHP 5+).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite3.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
I'm using PhpStorm to host PHP.
Whenever I try to run the function i get this:
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in **archive** Stack trace: #0 {main} thrown in **archive**
And my code looks like follows:
<?php
$con = mysqli_connect("localhost","root","","aula") or die(mysqli_error($con));
mysqli_query($con, 'SET NAMES utf8') or die(mysqli_error($con));
On the second line I already get the error. How can I install the extensions?
Thanks in advance.
Please make sure both extension=php_mysql.dll and extension=php_mysqli.dll are uncommented in php.in, mysqli is the "improved" MySQL library but that does not necessarily mean it replaces the mysql library entirely.
Also please make sure you set right php PATH environment variable.
change from
extension_dir = "ext"
to
extension_dir = "C:\Apache24\php\ext"
(Working on windows)
I was facing exactly the same issue.
In my case, the problem was that I had saved the php.ini file as a text file. As soon as I converted the text file to "All Files" in notepad and gave it the ".ini" extension, it became a "Configuration Settings File" and it worked.
You may check if this is the case by going through the loaded configuration file row in phpinfo(). If the value is 'none', you may be facing a similar issue.
Note: I had already uncommented the extensions and fixed the extension directory.

The mbstring extension is missing Windows AMPPS

I am running the AMPPS stack on Windows 10. I have been trying to get the configurations changed in php.ini while moving a Drupal site to my local environment. However, in the process I seem to have broken something. phppMyAdmin gives the following error:
The mbstring extension is missing. Please check your PHP
configuration.
When I check the php.ini, the extension is enabled:
extension_dir = "C:\Program Files (x86)\Ampps\php-5.3\ext"
extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
extension=php_soap.dll
;extension=php_sockets.dll
extension=php_sqlite3.dll
;extension=php_tidy.dll
extension=php_xmlrpc.dll
;extension=php_xsl.dll
extension=php_com_dotnet.dll
extension=php_mongo.dll
What could be going wrong? Do I have a wrong extension directory selected?
You should check the phpinfo() for web and run php -m command for CLI if you don't see the extension in these pages then you should check the php.ini directory in the phpinfo page and alter that file.
This code in a e.g. phpinfo.php file will show you the php info page:
<?php phpinfo(); ?>

Drupal Site Migration Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY'

I am migrating a Drupal site to local environment. Currently I get the following error when I refresh the browser:
Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY'
I have read that it may be a problem with pdo_mysql extension. However, mine seems to be installed and enabled. What else could it be?
Here is the relevant excerpt from the php.ini file:
extension_dir = C:/Program Files (x86)/Ampps/php/ext
extension=php_sqlsrv_55_ts.dll
extension=php_pdo_sqlsrv_55_ts.dll
extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dl
extension=php_mssql.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
extension=php_soap.dll
;extension=php_sockets.dll
extension=php_sqlite3.dll
;extension=php_tidy.dll
extension=php_xmlrpc.dll
;extension=php_xsl.dll
extension=php_com_dotnet.dll
extension=php_mongo.dll
I was able to fix this by moving my AMPPS stack directory to C:/
It appears that having it in Program Files (x86) causes some naming problems with Apache and PHP configurations because of spaces in the name of the directory.

The mysqli|mysql extension is missing

I cannot find a way to solve this. I have done pretty much everything I can think of, I am kind of new to this stuff, so sometimes I am not sure I am doing it right. I have xampp and am trying to use phpmyadmin to work with databases. I have added the extensions:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_mbstring.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mssql.dll
;extension=mysqli.so
extension=php_mbstring.dll
extension=php_exif.dll Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pdo_sqlite_external.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
What am I doing wrong?
Strange, because php comes with the mysqli extension as part of it's core extensions.
1 - Make sure the file php_mysqli.dll exists in:
drive:\xamp_install_dir\bin\php\php<phpversion>\ext\
if so, copy the following line to your php.ini
extension=php_mysqli.dll
2 - Restart apache, and create a file named test.php with the following content:
<?php
echo phpinfo();
?>
3 - Open it on your browser a search for :
4 - Found it?
Yes: Good, you're ready to go.
No: You may need to re-install wamp
NOTE:
Don't worry about php_mysql.dll because it's deprecated.

Categories