SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help mysqli_connect

    I am brushing up on the little php I knew, bought Kevin Yanks book and when it came to the data base connect got this message.

    Fatal error: Call to undefined function mysqli_connect() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2

    Guess php.ini

    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
    ; at MYSQL_PORT.
    mysqli.default_port = 3306

    ; Default socket name for local MySQL connects. If empty, uses the built-in
    ; MySQL defaults.
    mysqli.default_socket =

    ; Default host for mysql_connect() (doesn't apply in safe mode).
    mysqli.default_host = localhost

    ; Default user for mysql_connect() (doesn't apply in safe mode).
    mysqli.default_user = root

    this is as it is
    Can any one help Thanks

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Have a look in php.ini for these two lines:

    extension=php_mysql.dll
    extension=php_mysqli.dll
    If either of them have a ; at the start, remove the ; save and restart the server.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank You for taking the time! I did have one witch was the mysql extension and restarted but no difference notcice another person with the same problem. I am totally stumped even looked up on some other sites do not no enough about Apatche to help myself and ever thing in the book has worked till chapter 4. I cannot go anywhere till problem solved

  4. #4
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SpacePhoenix View Post
    Have a look in php.ini for these two lines:



    If either of them have a ; at the start, remove the ; save and restart the server.
    I tried this script Connect from the Build your own data base driven web site.
    and uploaded it to my host and it works, So it is oviously in my set up of either php.ini and as Far as Apatche goes HELP I have no idea not that I do about PHP.ini I really REALLY do not understand I saw another on the forum with the same problem, If any of you guys have had this before help or know enought to know help please PLEASE HELP thankyou !!!

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    PHP: Installation - Manual read that page really carefully.

    If you cannot work out how to restart Apache in order to make PHP act upon any edits you made to php.ini , then just reboot your machine.

    What OS are you using?

  6. #6
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    PHP: Installation - Manual read that page really carefully.

    If you cannot work out how to restart Apache in order to make PHP act upon any edits you made to php.ini , then just reboot your machine.

    What OS are you using?
    Windows 7

  7. #7
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    This reply is only concerned with how to restart Apache on Windows - so that you avoid rebooting the entire machine.

    I do not have Windows 7 but in in w2k, vista and so on the procedure is roughly this:

    Go to your control panel
    choose "Services"
    Find Apache*, select it and select "restart this service"

    *The same goes for IIS, nginx and so on.

    Maybe if you have WAMP installed you can use its control panel to restart Apache.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •