PHP Fatal error: Call to undefined function mysql_connect() in IIS - php

The same code works in Xampp. But if try to run it on IIS below error occurs.
"PHP Fatal error: Call to undefined function mysql_connect()"
I'm stuck with this error from couple of days.
I tried changing my php.in . My phpinfo.php points to correct .ini file
Please suggest me a way.
part of my php.ini file:
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mysql_libmysql.dll

Related

Built-in function goes undefined

I have a laravel project up and running in my localhost. but when i upload all files to the server. it gives me error: The built-in function in laravel goes undefined.
FatalErrorException in Encrypter.php line 71: Call to undefined
function Illuminate\Encryption\openssl_encrypt()
How can i solve this?
You should edit php.ini file and uncomment an extension. For example, change this:
;extension=php_openssl.dll
to this:
extension=php_openssl.dll
just edit php.ini and uncomment this like
;extension=php_openssl.dll
chnaged to
extension=php_openssl.dll

Fatal error: Call to undefined function mssql_connect() or sqlsrv_connect() in xampp

I did all the changes given here but I still not connect SQL server on my php 5.6 version.
I tried with mssql_connect() and sqlsrv_connect() both.
I changed
; On windows: extension_dir = "ext"
to:
; On windows: extension_dir = "D:\xampp\php\ext"
I have installed .dlls too. But result is still:
Fatal error: Call to undefined function sqlsrv_connect()
or
Fatal error: Call to undefined function mssql_connect()
can anyone help me??
mssql_connect() is no longer supported by PHP since PHP 7.0 and was depreciated in 5.3.
Create a phpinfo.php file:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
Open the page, and on the first page that's opened, third from the bottom, check if the registered streams contains 'sqlsrv':
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, phar, sqlsrv
If it doesn't then you have to enable the module.
Try uncomment this code that you changed:
From:
; On windows: extension_dir = "D:\xampp\php\ext" "
To:
On windows: extension_dir = "D:\xampp\php\ext"
And let us know the outcome.

Fatal error: Call to undefined function mysql_connect() and The mysqli extension is missing

I have below two in my php.ini file
extension=php_mysql.dll
extension=php_mysqli.dll
from the php.info(), can see below is correct.
Loaded Configuration File C:\Program Files (x86)\PHP\v5.3\php.ini
I have only one version php installed.
What else should I try?
The strange thing is, if I load my application the error is
Fatal error: Call to undefined function mysql_connect()
but if I load phpMyAdmin, after login the error is
The mysqli extension is missing. Please check your PHP configuration.
<img class="icon" src="./themes/pmahomme/img/b_help.png" width="11" height="11" alt="Documentation" title="Documentation" />
Make sure the path to php.ini is set and is visible in
at loaded configuration file.
if you are using windows.. make sure the use of / and \
in apache httpd.conf
it should be
PHPIniDir "C:/php/5.5/"

Call to undefined function curl_init() in wampp

I am getting an error. I have done the following:
Find file php.ini and uncomment in wamp apache folder
Find file php.ini and uncomment in wamp php folder
checked in wamp extensions
download file and replace php_curl-5.3.13-nts-VC9-x64.zip
restart wamp.
But I still get error
Fatal error: Call to undefined function curl_init() in C:\wamp\www\wordpress\wp-content\plugins\test\curl_http_client.php on line 66
Call to undefined function curl_init
You either edit wrong php.ini file or something is missing on your system, preventing curl extension from loading. You shall check with phpinfo() where is proper php.ini, then check if you got extension entry for cURL really enabled. If so and it is still not working then next step should be checking Apache's error.log looking for detailed error messages from PHP.

Fatal error: Call to undefined function mb_detect_encoding() in C:\Users\Jarek\mywebsite\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177

I am trying to set up phpMyAdmin, and i was following this site , but i got an error about "Fatal error: Call to undefined function mb_detect_encoding() in C:\Users\Jarek\mywebsite\phpMyAdmin\libraries\php-gettext\gettext.inc on line 177", and i searched this error online, Most of suggestion are uncommon some lines in php.ini, but it didn't work for me.
This is the site tell you how to solve problem with this error.
solve 1
solve 2
php.ini is in my php folder which is located in c diver.
prompt command to check path
Every time i changed config, i also did restart apache.
I also tried to write some piece of code of php as below:
$con=mysqli_connect("127.0.0.1","root","xxxxxxx","morris_db");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
and open my browser, and type localhost/index.php, it shows me an error about "Fatal error: Call to undefined function mysqli_connect() in C:\Users\Jarek\mywebsite\index.php on line 8"
Try adding these extensions in the PHP.ini
extension=php_mbstring.dll
extension=php_gettext.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
Also check whether the PHP folder exists in the PATH.

Categories