1

I've searched in "google" a lot but I have not found a perfect answer. I've seen many questions in "stackoverflow" too but these do not describe my problem.

Fatal error: Call to undefined function mysqli_connect() and Fatal error: mysqli_connect() these two question are close to my problem,but these are not solving my problem,anyway my problem is:

I've written php code which will connect my mysql database server.

<?php
  echo "entering db";
  $link=mysqli_connect('localhost','root','qwerty');
  echo "entered";
?>

NOTES :

I've edited

  1. extension_dir = "C:\PHP\ext"
  2. extension=php_mysqli.dll
  3. result of

    ini_set('display_errors', 1); error_reporting(E_ALL)** ; is the same **Fatal error: Call to undefined function mysqli_connect()

  4. I have executed echo 'ini: ', get_cfg_var('cfg_file_path'); and its displaying C:\PHP\php.ini

I am using Apache 2.2.11 and PHP 5.2.17 and MySQL 5.5 does anyone have any idea,whats wrong there?

  1. And I've "PHP_MYSQLI.DLL" In EXT folder.

EDIT : surprisingly there is no information about database server in phpinfo().can anyone tell me now what is the problem. EDIT 2:

which one to download non thread safe or thread safe..i have downloaded non thread safe

Community
  • 1
  • 1
RbG
  • 3,181
  • 3
  • 32
  • 43
  • should i reinstall my php??? – RbG Jun 22 '13 at 11:32
  • 1
    Have you restarted your web server? – Pekka Jun 22 '13 at 11:32
  • Do enable display_errors and display_startup_errors and see what happens. You probably have the wrong extension - and by the way, you should update your PHP. 5.2 is out of service for years, 5.3 just went into "only security patches for some months" mode. The version you are supposed to use by now is 5.4, as 5.5.0 was just released. – Sven Jun 22 '13 at 11:33
  • yes i have restarted my apache???that was the first thing i did am seeing this error @Pekka웃 – RbG Jun 22 '13 at 11:34
  • Are you sure you are editing the right php.ini? Is it the one showing up when you run ` phpinfo(); ?>` – Pekka Jun 22 '13 at 11:35
  • @Sven Do enable display_errors and display_startup_errors and see what happens...how to check that..can you please tell me – RbG Jun 22 '13 at 11:35
  • @Pekka웃 c:\PHP\php.ini is the correct ini i guess..and that was the output of echo 'ini: ', get_cfg_var('cfg_file_path'); – RbG Jun 22 '13 at 11:38
  • I would double-check in `phpinfo()`. You never know. – Pekka Jun 22 '13 at 11:39
  • @Pekka웃 what to check in phpinfo???you just tell me i will give you the report?????i have executed it – RbG Jun 22 '13 at 11:42
  • phpinfo tells you the correct path to the php.ini used, as well as all settings that are set there. It also tells you about all extensions loaded. Your mysqli extension must appear, but most likely will not because otherwise you wouldn't get this error. – Sven Jun 22 '13 at 12:01
  • Loaded Configuration File C:\PHP\php.ini surprising there is no information about database server @Sven – RbG Jun 22 '13 at 12:18
  • There is no mention of `mysqli` inside PHP.ini? Then this is really strange – Pekka Jun 22 '13 at 12:35
  • so i need to reinstall it right??? @Pekka웃 – RbG Jun 22 '13 at 12:59
  • I don't know whether a reinstall will help. Did the DLL come with PHP, or did you download it from elsewhere? – Pekka Jun 22 '13 at 13:07
  • it came with php as usual..why??@Pekka웃 – RbG Jun 22 '13 at 13:36

1 Answers1

1

i dont know it will help others or not..but still i am giving this answer because i didnt get any proper solution here.i have tried all error check and i am sure there was no mistake in my code.and as i said all the extensions were properly loaded i didnt have any proper solution to that.i un-installed all my set up and install wamp instead of installing all the packages individually.the same code is running perfect now in wamp

RbG
  • 3,181
  • 3
  • 32
  • 43
  • Yes thank you, helped me realize the problem was with my WampServer... It showed green but said offline still. I suppose I will re-install. – Andrew May 23 '14 at 20:13